Created
August 5, 2017 22:12
-
-
Save aramkoukia/ccc745e6e1c916bfb73914a5747c4b2a to your computer and use it in GitHub Desktop.
This file contains hidden or 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 EFRepository | |
| { | |
| public List<Product> GetAllProductsByCategory(int categoryId) | |
| { | |
| using (var db = new EFCore2TestContext()) | |
| { | |
| var products = db.Product | |
| .Where(b => b.ProductCategoryId == categoryId) | |
| .OrderBy(b => b.ProductNumber) | |
| .Include(p => p.ProductCategory) | |
| .ToList(); | |
| return products; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment