コード例 #1
0
        public async Task <ActionResult <CompetenceViewModel> > Get(int id, bool includeConsultant = false)
        {
            try
            {
                Competence result = await repository.GetCompetenceAsync(id);

                if (result == null)
                {
                    return(NotFound());
                }
                return(mapper.Map <CompetenceViewModel>(result));
            }
            catch (Exception)
            {
                return(this.StatusCode(StatusCodes.Status500InternalServerError, "Error in database"));
            }
        }