示例#1
0
        public virtual async Task <IActionResult> Get(TPkType id)
        {
            try {
                var obj = await _repo.GetAsync(id);

                if (obj == null)
                {
                    return(NotFound());
                }

                var resoure = _mapper.Map <TEntityResource>(obj);

                return(Ok(resoure));
            } catch (Exception ex) {
                _logger.LogError(ex.Message);
                return(BadRequest());
            }
        }
 public async Task <IEnumerable <User> > GetUsers()
 {
     return(await _userRepo.GetAsync());
 }
 public async Task <IEnumerable <Workout> > GetWorkouts()
 {
     return(await _workoutRepo.GetAsync());
 }