示例#1
0
        public async Task <IActionResult> Get(string id)
        {
            try
            {
                var role = await _provider.GetAsync(id);

                return(Ok(role));
            }
            catch (NotFoundException e)
            {
                Logger.LogDebug("Failed to get role with id '{0}': {1}", id, e.Message);

                return(NotFound(e.Message));
            }
            catch (Exception e)
            {
                Logger.LogError(e, "An error occured while getting a role by id '{0}'", id);

                return(InternalServerError(e.Message));
            }
        }