public void Update(int id, InstanceContent Entity) { using (var ctx = context) { var FoundEntity = ctx.Set <InstanceContent>().Find(id); if (FoundEntity != null) { ctx.Entry(FoundEntity).CurrentValues.SetValues(Entity); } ctx.SaveChanges(); } }
// #04 - Methods (Single Operations) public void Insert(InstanceContent Entity) { context.Set <InstanceContent>().Add(Entity); }
public void Delete(InstanceContent Entity) { context.Set <InstanceContent>().Remove(Entity); }
public void Add(InstanceContent _InstanceContent) { List.Add(_InstanceContent); }