Exemplo n.º 1
0
        public GetPizzasResponse GetAll()
        {
            GetPizzasResponse   result = new GetPizzasResponse();
            IEnumerable <Pizza> allPizzas;

            try
            {
                allPizzas     = _pizzaRepository.FindAll();
                result.Pizzas = allPizzas.ConvertToViewModels();
            }
            catch (Exception ex)
            {
                result.StatusCode       = HttpStatusCode.InternalServerError;
                result.StatusDesciption = ex.Message;
            }

            return(result);
        }