From dd0a9a598d6c351cfeedfaca79cdc1c366f7b039 Mon Sep 17 00:00:00 2001 From: Eric Fleming Date: Fri, 1 Mar 2019 22:09:07 -0500 Subject: [PATCH] Removing Add --- src/ApplicationCore/Interfaces/IRepository.cs | 1 - src/Infrastructure/Data/EfRepository.cs | 8 -------- 2 files changed, 9 deletions(-) diff --git a/src/ApplicationCore/Interfaces/IRepository.cs b/src/ApplicationCore/Interfaces/IRepository.cs index 5f7f95c..9f02c99 100644 --- a/src/ApplicationCore/Interfaces/IRepository.cs +++ b/src/ApplicationCore/Interfaces/IRepository.cs @@ -6,7 +6,6 @@ namespace Microsoft.eShopWeb.ApplicationCore.Interfaces public interface IRepository where T : BaseEntity { T GetSingleBySpec(ISpecification spec); - T Add(T entity); void Update(T entity); void Delete(T entity); int Count(ISpecification spec); diff --git a/src/Infrastructure/Data/EfRepository.cs b/src/Infrastructure/Data/EfRepository.cs index 7373656..e81a5d1 100644 --- a/src/Infrastructure/Data/EfRepository.cs +++ b/src/Infrastructure/Data/EfRepository.cs @@ -55,14 +55,6 @@ namespace Microsoft.eShopWeb.Infrastructure.Data return await ApplySpecification(spec).CountAsync(); } - public T Add(T entity) - { - _dbContext.Set().Add(entity); - _dbContext.SaveChanges(); - - return entity; - } - public async Task AddAsync(T entity) { _dbContext.Set().Add(entity);