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); }
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; }