public HttpResponseMessage Login(HttpRequestMessage req, DL_Login login) { if (!String.IsNullOrEmpty(login.Mobile) && !String.IsNullOrEmpty(login.Pass)) { BL_Login blLogin = new BL_Login(); List <DL_LoginReturn> dlLoginRet = blLogin.CheckLogin(login); //Validate Login if (blLogin._IsSuccess) { return(req.CreateResponse <List <DL_LoginReturn> >(HttpStatusCode.OK, dlLoginRet)); } else { return(req.CreateErrorResponse(HttpStatusCode.InternalServerError, "ServerError")); } } return(req.CreateErrorResponse(HttpStatusCode.BadRequest, "Bad Request")); }