コード例 #1
0
        public virtual void Insert(OrgChartShape shape, ModelStateDictionary modelState)
        {
            db.OrgChartShapes.Add(shape);
            db.SaveChanges();

            shape.Id = shape.Id;
        }
コード例 #2
0
        public virtual void Delete(OrgChartShape shape, ModelStateDictionary modelState)
        {
            db.OrgChartShapes.Attach(shape);

            Delete(shape);

            db.OrgChartShapes.Remove(shape);
            db.SaveChanges();
        }
コード例 #3
0
        private void Delete(OrgChartShape shape)
        {
            var result = db.OrgChartShapes.Where(t => t.Id == shape.Id).First();

            db.OrgChartShapes.Remove(result);
        }
コード例 #4
0
 public virtual void Update(OrgChartShape shape, ModelStateDictionary modelState)
 {
     db.OrgChartShapes.Attach(shape);
     db.Entry(shape).State = EntityState.Modified;
     db.SaveChanges();
 }