public List <T> GetList() { using (var db = new WebContextDb()) { return(db.Set <T>().ToList()); } }
public Artist GetById(int id) { using (var db = new WebContextDb()) { return(db.Artist.FirstOrDefault(p => p.ArtistId == id)); } }
public List <Artist> GetlistBySize(int size) { using (var db = new WebContextDb()) { return(db.Artist.OrderByDescending(p => p.ArtistId). Take(size).ToList()); } }
public int Delete(T entity) { using (var db = new WebContextDb()) { db.Entry(entity).State = System.Data.Entity.EntityState.Deleted; return(db.SaveChanges()); } }