Skip to content

Instantly share code, notes, and snippets.

@tonysneed
Created December 21, 2018 20:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonysneed/9a7544ee04106fe3905c60b5e01914dd to your computer and use it in GitHub Desktop.
Save tonysneed/9a7544ee04106fe3905c60b5e01914dd to your computer and use it in GitHub Desktop.
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