public void Update(WriteOfList entity) { var house = db.WriteOfList.FirstOrDefault(u => u.Id == entity.Id); house.MedicalBillId = entity.MedicalBillId; house.MedicalBills = entity.MedicalBills; house.ShelfLife = entity.ShelfLife; house.DateOfManufacture = entity.DateOfManufacture; db.SaveChanges(); }
public static WriteOfList FromDTO(WriteOfListDTO storeHouse) { WriteOfList f = new WriteOfList { Id = storeHouse.Id, DateOfManufacture = storeHouse.DateOfManufacture, ShelfLife = storeHouse.ShelfLife, MedicalBills = FromDTO(storeHouse.MedicalBills) }; return(f); }
public void Remove(WriteOfList entity) { db.WriteOfList.Remove(db.WriteOfList.FirstOrDefault(u => u.Id == entity.Id)); db.SaveChanges(); }
public void Add(WriteOfList entity) { db.Attach(entity); db.WriteOfList.Add(entity); db.SaveChanges(); }