Created
August 10, 2015 18:28
-
-
Save mariobot/427b3aa1df3357784be7 to your computer and use it in GitHub Desktop.
GenericRepository
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace CodedHomes.Data | |
{ | |
public class GenericRepository<T> : IRepository<T> where T : class | |
{ | |
protected DbSet<T> DBSet { get; set; } | |
protected DbContext Context { get; set; } | |
public GenericRepository(DbContext context) | |
{ | |
if (context == null) | |
throw new ArgumentException("An argument of context its necesary."); | |
this.Context = context; | |
this.DBSet = this.Context.Set<T>(); | |
} | |
public IQueryable<T> GetAll() { | |
throw new NotImplementedException(); | |
} | |
public T GetById(int id) | |
{ | |
throw new NotImplementedException(); | |
} | |
public void Add(T entity) { | |
throw new NotImplementedException(); | |
} | |
public void Update(T entity) | |
{ | |
throw new NotImplementedException(); | |
} | |
public void Delete(T entity) | |
{ | |
throw new NotImplementedException(); | |
} | |
public void Delete(int id) | |
{ | |
throw new NotImplementedException(); | |
} | |
public void Detach(T entity) | |
{ | |
throw new NotImplementedException(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment