public void DeleteProperty(ChainsDBEntities context, Guid id, string username, DateTime now) { var propertyToDelete = context.Properties.Find(id); propertyToDelete.DateDeleted = now; propertyToDelete.DeletedBy = username; propertyToDelete.Deleted = true; context.SaveChanges(); }
public void Update <T>(ChainsDBEntities context, T item, Guid id) { var entity = context.Set(typeof(T)).Find(id); if (entity == null) { return; } context.Entry(entity).CurrentValues.SetValues(item); context.SaveChanges(); }
public void AddPropertyCheckListItems(ChainsDBEntities context, List <PropertyCheckListitem> checkListItems) { context.PropertyCheckListitems.AddRange(checkListItems); context.SaveChanges(); }
public void AddItem <T>(ChainsDBEntities context, T item) { context.Set(typeof(T)).Add(item); context.SaveChanges(); }