public void Inserir(IngredienteRequest ingredienteRequest) { try { var ingrediente = new Ingrediente(ingredienteRequest); //if validando notificação var ingredienteCollection = IngredienteMapping.ConverteParaIngredienteCollection(ingrediente); _ingredienteRepository.Inserir(ingredienteCollection); } catch (System.Exception) { throw; } }
public IList <IngredienteResponse> ListarTodos() { try { var ingredientesResponse = new List <IngredienteResponse>(); var ingredientesCollection = _ingredienteRepository.ListarTodos(); foreach (var ingredienteCollection in ingredientesCollection) { ingredientesResponse.Add(IngredienteMapping.ConverteParaIngredienteResponse(ingredienteCollection)); } return(ingredientesResponse); } catch (System.Exception) { throw; } }