コード例 #1
0
        public IActionResult GetName(string name)
        {
            if (name.Length == 0)
            {
                return(BadRequest("Name is invalid!"));
            }
            User user = _srv.FindUserByName(name);

            if (user == null)
            {
                return(NotFound($"Couldn't find user with name: {name}"));
            }
            return(Ok(user));
        }