示例#1
0
        public async Task <IActionResult> GetById(int id)
        {
            var user = await _context.Users.FirstOrDefaultAsync(u => u.Id.Equals(id));

            if (user == null)
            {
                return(NotFound(nameof(user)));
            }

            return(Ok(UserResource.GetUserResource(user)));
        }