Created
December 21, 2018 20:27
-
-
Save tonysneed/9a7544ee04106fe3905c60b5e01914dd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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