public static void Update(Entity.PlanRegulation data) { using (var context = new Entity.OiWeb()) { var planregulation = context.PlanRegulations.Find(data.idPlanRegulation); if (planregulation != null) { context.PlanRegulations.Attach(planregulation); var entry = context.Entry(planregulation); entry.Property(e => e.name).IsModified = true; entry.Property(e => e.link).IsModified = true; entry.Property(e => e.type).IsModified = true; context.SaveChanges(); } } }
public static void UpdateModal(Entity.Modal data) { using (var context = new Entity.OiWeb()) { var modal = context.Modals.Find(data.idModal); if (modal != null) { modal.name = data.name; modal.description = data.description; context.Modals.Attach(modal); var entry = context.Entry(modal); entry.Property(e => e.name).IsModified = true; entry.Property(e => e.description).IsModified = true; context.SaveChanges(); } } }