Exemplo n.º 1
0
        public async Task <IActionResult> GetAll()
        {
            var result = await _services.GetAllAsync();

            if (result.IsValid)
            {
                return(Ok(result.Result));
            }
            return(BadRequest(result.ErrorsList));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Index()
        {
            var result = await _services.GetAllAsync();

            if (result.IsValid)
            {
                return(View(result.Result));
            }
            TempData["ErrorsList"] = result.ErrorsList;
            return(View());
        }
Exemplo n.º 3
0
        public async Task <SelectList> GetTravel(string hashIdSelectedValue = null)
        {
            var travel = await _travelService.GetAllAsync();

            return(travel.IsValid ? new SelectList(travel.Result, "HashId", "Name", hashIdSelectedValue) : null);
        }
Exemplo n.º 4
0
 public async Task <IActionResult> GetAll()
 {
     return(Ok(await _services.GetAllAsync()));
 }
Exemplo n.º 5
0
        public async Task <IActionResult> Index()
        {
            var result = await _services.GetAllAsync();

            return(View(result.Result));
        }