public Response GetIngredient(GetIngredientRequest request) { List <string> ingredientList = new List <string>(); try { var dataSet = _dal.GetIngredient(request); var table = dataSet.Tables[0]; for (int i = 0; i < dataSet.Tables[0].Rows.Count; i++) { string temp = table.Rows[i]["ingredient"].ToString(); ingredientList.Add(temp); } GetIngredientResponse ret = new GetIngredientResponseOk { Ingredient = ingredientList.ToArray() }; return(ret); } catch (Exception ex) { return(new AppResponseError(ex.Message)); } }
public DataSet GetIngredient(GetIngredientRequest request) { var cmd = new MySqlCommand { Connection = _conn, CommandText = "getIngredient" }; var param = _infraDal.GetParameter("p_ingredient", MySqlDbType.VarChar, request.Ingredient); cmd.Parameters.Add(param); return(_infraDal.ExecSpQuery(cmd)); }
public DTO.Ingredient Get(GetIngredientRequest request) { try { var ingredient = _ingredientRepository.FindBy(request.Id); ingredient.ThrowExceptionIfRecordIsNull(); return(_ingredientFactory.Execute(ingredient)); } catch (DataAccessException) { throw new ApplicationException(); } }
public Ingredient Get(GetIngredientRequest request) { return(_ingredientService.Get(request)); }
public Response GetIngredient([FromBody] GetIngredientRequest request) { var ret = _service.GetIngredient(request); return(ret); }