public HttpResponseMessage GetUsers()
 {
     UserManager userManager = new UserManager();
     var users = userManager.FindUsers();
     if (users != null)
         return Request.CreateResponse(HttpStatusCode.OK, users);
     else
         return Request.CreateErrorResponse(HttpStatusCode.NotFound, "No users found");
 }
Example #2
0
 public HttpResponseMessage GetUsers()
 {
     UserManager userManager = new UserManager();
     try
     {
         var users = userManager.FindUsers();
         HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created, users);
         return response;
     }
     catch (Exception ex)
     {
         return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex.Message);
     }
 }