public void Delete(MedicineModel medicine) { Medicine obj; if (medicine.Id != 0) { obj = Medicine.Get(medicine.Id); } else { obj = Medicine.New(); } _mapper.Map(medicine, obj); obj.Delete(); }
public MedicineModel Save(MedicineModel medicine) { Medicine obj; if (medicine.Id != 0) { obj = Medicine.Get(medicine.Id); } else { obj = Medicine.New(); } _mapper.Map(medicine, obj); return(_mapper.Map <MedicineModel>(obj.Save())); }