7.4.5 Creating the Product Repository; e.g. 7.13 EFProductRepository.cs

This commit is contained in:
Jason Zhu 2021-08-21 16:05:33 +10:00
parent e44a5f26aa
commit 5ec3a1b095
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,19 @@
using SportsStore.Domain.Abstract;
using SportsStore.Domain.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SportsStore.Domain.Concrete
{
public class EFProductRepository : IProductRepository
{
private EFDbContext context = new EFDbContext();
public IQueryable<Product> Products
{
get { return context.Products; }
}
}
}

View File

@ -70,6 +70,7 @@
<Compile Include="Abstract\IProductRepository.cs" />
<Compile Include="Class1.cs" />
<Compile Include="Concrete\EFDbContext.cs" />
<Compile Include="Concrete\EFProductRepository.cs" />
<Compile Include="Entities\Product.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>