Browse Source

Removing Add

main
Eric Fleming 7 years ago
parent
commit
dd0a9a598d
  1. 1
      src/ApplicationCore/Interfaces/IRepository.cs
  2. 8
      src/Infrastructure/Data/EfRepository.cs

1
src/ApplicationCore/Interfaces/IRepository.cs

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

8
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<T>().Add(entity);
_dbContext.SaveChanges();
return entity;
}
public async Task<T> AddAsync(T entity)
{
_dbContext.Set<T>().Add(entity);

Loading…
Cancel
Save