Skip to content

Proposal: AsMaybeAsync #528

@mollsju

Description

@mollsju

Hello!
Any chance AsMaybeAsync could be added, just as we have ToResultAsync?

It would allow for less clutter when combined with EF.

Current:
Maybe<Entity> maybeEntity = (await dbContext.Entity.FirstOrDefaultAsync(x => x.Id == EntityId)).AsMaybe();

With AsMaybeAsync:
Maybe<Entity> maybeEntity = await dbContext.Entity.FirstOrDefaultAsync(x => x.Id == EntityId).AsMaybeAsync();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions