public bool Update(FoodViewModel foodToUpdate) { Food domainFood = foodToUpdate.ConvertToDomain(); try { _unitOfWork.FoodRepository.Update(domainFood); _unitOfWork.Save(); } catch { return false; } return true; }
public bool Insert(FoodViewModel food) { Food domainFood = food.ConvertToDomain(); try { _unitOfWork.FoodRepository.Insert(domainFood); _unitOfWork.Save(); } catch { return false; } return true; }