7.4.5 Creating the Product Repository; Listing 7-14. The Contents of the EFProductRepository.cs File

chap07
Jason Zhu 2021-09-08 11:43:51 +10:00
parent 997043a3db
commit 46fbd3ed91
2 changed files with 17 additions and 0 deletions

View File

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

View File

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