public virtual void Insert(OrgChartShape shape, ModelStateDictionary modelState) { db.OrgChartShapes.Add(shape); db.SaveChanges(); shape.Id = shape.Id; }
public virtual void Delete(OrgChartShape shape, ModelStateDictionary modelState) { db.OrgChartShapes.Attach(shape); Delete(shape); db.OrgChartShapes.Remove(shape); db.SaveChanges(); }
private void Delete(OrgChartShape shape) { var result = db.OrgChartShapes.Where(t => t.Id == shape.Id).First(); db.OrgChartShapes.Remove(result); }
public virtual void Update(OrgChartShape shape, ModelStateDictionary modelState) { db.OrgChartShapes.Attach(shape); db.Entry(shape).State = EntityState.Modified; db.SaveChanges(); }