Skip to content

Commit

Permalink
added Add method
Browse files Browse the repository at this point in the history
  • Loading branch information
alimon808 committed Sep 19, 2017
1 parent 5b80ea7 commit 2eae1c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions ContosoUniversity.Data/Interfaces/IRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public interface IRepository<T> where T : BaseEntity
{
IQueryable<T> GetAll();
IQueryable<T> Get(int id);
void Add(T entity);
Task AddAsync(T entity);
void Update(T entity, byte[] rowVersion);
void Delete(T entity);
Expand Down
5 changes: 5 additions & 0 deletions ContosoUniversity.Data/Repositories/Repository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,10 @@ public DbConnection GetDbConnection()
{
return context.Database.GetDbConnection();
}

public void Add(T entity)
{
context.Add<T>(entity);
}
}
}

0 comments on commit 2eae1c4

Please sign in to comment.