Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public class ProductRepository : IProductRepository
{
public SampleDbContext Context { get; }
public ProductRepository(SampleDbContext context)
{
Context = context;
}
public async Task<Product> GetProduct(int id)
{
return await Context.Products.SingleOrDefaultAsync(e => e.Id == id);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.