示例#1
0
        public object Get(UserRequest request)
        {
            User         user;
            UserResponse Response = new UserResponse();

            if (request.Login.IsNullOrEmpty())
            {
                base.Response.StatusCode = (int)HttpStatusCode.BadRequest;
                return(Response);
            }
            user = Response.Get(request);
            if (user == null)
            {
                base.Response.StatusCode = (int)HttpStatusCode.NotFound;
                return(Response);
            }
            string response = JsonConvert.SerializeObject(user, Formatting.Indented);

            return(response);
        }
示例#2
0
 public object Get(UserRequest request)
 {
     User user;
     UserResponse Response = new UserResponse();
     if (request.Login.IsNullOrEmpty())
     {
         base.Response.StatusCode = (int)HttpStatusCode.BadRequest;
         return Response;
     }
     user = Response.Get(request);
     if (user == null)
     {
         base.Response.StatusCode = (int)HttpStatusCode.NotFound;
         return Response;
     }
     string response = JsonConvert.SerializeObject(user,Formatting.Indented);
     return response;
 }