private static List <Medicine> FillObjectData(string query) { var medicines = _sqlManager.GetMedicine(query); foreach (var medicine in medicines) { medicine.Ingredients = IngredientManager.GetByMedicineId(medicine.Id); } return(medicines); }
public static Medicine Update(Medicine medicine) { if (medicine == null) { throw new ArgumentException("Medicine information was not provided"); } var query = SqlQueryGeneration.UpdateMedicine(medicine); var returnMedicine = _sqlManager.UpdateMedicine(query, medicine.Image); returnMedicine.Ingredients = IngredientManager.GetByMedicineId(returnMedicine.Id); return(returnMedicine); }