public virtual TEntity GetEntity(int id) { var entity = context.Set <TEntity>().FirstOrDefault(x => x.Id == id); if (entity == null) { return(null); } else { return(GetQueryable().FirstOrDefault(x => x.Id == id)); } }
public BaseRepository(MusicLibraryContext context) { Context = context; DbSet = context.Set <T>(); }
public MusicRepository(MusicLibraryContext _context) { this._context = _context; table = _context.Set <T>(); }
public MusicRepository() { this._context = new MusicLibraryContext(); table = _context.Set <T>(); }