Removing Add
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user