public HttpResponseMessage GetTenentAgreementByID(int AssetName) { TenentAgreementController customObj = new TenentAgreementController(); var getValidData = entities.TenentAgreements.Where(x => x.AssetName == AssetName).SingleOrDefault(); if (getValidData == null) { return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "404")); } return(Request.CreateResponse(HttpStatusCode.Created, getValidData)); }
public HttpResponseMessage GetTenentAgreement(string phoneNumber, string password) { TenentAgreementController customObj = new TenentAgreementController(); var getValidData = entities.TenentAgreements.Where(x => x.ContactNumbers == phoneNumber && x.TenentPassword == password).SingleOrDefault(); if (getValidData == null) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, "404")); } return(Request.CreateResponse(HttpStatusCode.Created, getValidData)); }