public IEnumerable <MstStateModel> GetMstStateList(MstStateModel objOrg) { using (sqlConnection = SqlUtility.GetConnection()) { IEnumerable <MstStateModel> GetMstStateList = sqlConnection.Query <MstStateModel>("Usp_GetMstStateList", commandType: CommandType.StoredProcedure).ToList(); return(GetMstStateList); } }
public HttpResponseMessage GetStateList([FromBody] MstStateModel objState) { try { GetStateListContext objStateContext = new GetStateListContext(); IEnumerable <MstStateModel> GetStateList = objStateContext.GetMstStateList(objState); return(Request.CreateResponse(HttpStatusCode.OK, GetStateList)); } catch (Exception ex) { //objErrorLogServices.LogError("Client", "GetClient", "", "", ex.Message.ToString()); return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Internal Server Error")); } }