コード例 #1
0
 public virtual void Remove(ModelType model)
 {
     using (var context = new Find3dPrintingDBContext())
     {
         context.Set <ModelType>().Remove(model);
         context.SaveChanges();
     }
 }
コード例 #2
0
        public virtual void Remove(int id)
        {
            ModelType modelToDelete = this.GetById(id);

            using (var context = new Find3dPrintingDBContext())
            {
                context.Set <ModelType>().Remove(modelToDelete);
                context.SaveChanges();
            }
        }