This package provides the extension methods FirstOrNoneAsync
, LastOrNoneAsync
and SingleOrNoneAsync
for EF Core's IQueryable<T>
objects.
These are analogous to the ones provided by EntityFrameworkQueryableExtensions
.
Example:
using System;
using Funcky.Extensions;
using Microsoft.EntityFrameworkCore;
DbContext context;
var firstPerson = await context.Set<Person>().FirstOrNoneAsync();
firstPerson.AndThen(p => Console.WriteLine($"Hello {p.FirstName}!"));