Removing Add

This commit is contained in:
Eric Fleming
2019-03-01 22:09:07 -05:00
parent b084d4e770
commit dd0a9a598d
2 changed files with 0 additions and 9 deletions

View File

@@ -6,7 +6,6 @@ namespace Microsoft.eShopWeb.ApplicationCore.Interfaces
public interface IRepository<T> where T : BaseEntity public interface IRepository<T> where T : BaseEntity
{ {
T GetSingleBySpec(ISpecification<T> spec); T GetSingleBySpec(ISpecification<T> spec);
T Add(T entity);
void Update(T entity); void Update(T entity);
void Delete(T entity); void Delete(T entity);
int Count(ISpecification<T> spec); int Count(ISpecification<T> spec);

View File

@@ -55,14 +55,6 @@ namespace Microsoft.eShopWeb.Infrastructure.Data
return await ApplySpecification(spec).CountAsync(); return await ApplySpecification(spec).CountAsync();
} }
public T Add(T entity)
{
_dbContext.Set<T>().Add(entity);
_dbContext.SaveChanges();
return entity;
}
public async Task<T> AddAsync(T entity) public async Task<T> AddAsync(T entity)
{ {
_dbContext.Set<T>().Add(entity); _dbContext.Set<T>().Add(entity);