Skip to content

Add a mechanism to map a response from a side effect #122

Description

@dacanizares

Current sample:

await
    from maybeBicicleta in
        from bicicleta in _repository.FindByIdAsync(id)
        select _mapper.Map<CompleteBicicletaViewModel>(bicicleta).AsMaybe()
    select maybeBicicleta.Match<IActionResult>(Ok, NotFound());

Expected to be used like:

await 
    from maybeBicicleta in new Maybe<int>(id).AwaitSideEffect(_repository.FindByIdAsync)
       // Add Map overload that works with Maybe
       from _mapper.Map<CompleteBicicletaViewModel>(maybeBicicleta)
    select maybeBicicleta.Match<IActionResult>(Ok, NotFound());

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions