예제 #1
0
        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();
        }
예제 #2
0
파일: Mapper.cs 프로젝트: MaxZay/StoreHouse
        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);
        }
예제 #3
0
 public void Remove(WriteOfList entity)
 {
     db.WriteOfList.Remove(db.WriteOfList.FirstOrDefault(u => u.Id == entity.Id));
     db.SaveChanges();
 }
예제 #4
0
 public void Add(WriteOfList entity)
 {
     db.Attach(entity);
     db.WriteOfList.Add(entity);
     db.SaveChanges();
 }