public async Task <IActionResult> GetAll()
        {
            var result = await _services.GetAllAsync();

            if (result.IsValid)
            {
                return(Ok(result.Result));
            }
            return(BadRequest(result.ErrorsList));
        }
Example #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());
        }
Example #3
0
        public async Task <SelectList> GetActivities(string hashIdSelectedValue = null)
        {
            var activities = await _activitiesService.GetAllAsync();

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

            return(View(result.Result));
        }