public virtual IList <ModelType> GetAll() { using (var context = new Find3dPrintingDBContext()) { return(context.Set <ModelType>().ToList()); } }
public virtual ModelType GetById(int id) { using (var context = new Find3dPrintingDBContext()) { return(context.Set <ModelType>().Find(id)); } }
public virtual void Remove(ModelType model) { using (var context = new Find3dPrintingDBContext()) { context.Set <ModelType>().Remove(model); context.SaveChanges(); } }
public virtual ModelType GetFirst() { return(new ModelType()); using (var context = new Find3dPrintingDBContext()) { return(context.Set <ModelType>().First()); } }
public virtual void Remove(int id) { ModelType modelToDelete = this.GetById(id); using (var context = new Find3dPrintingDBContext()) { context.Set <ModelType>().Remove(modelToDelete); context.SaveChanges(); } }