public IEnumerable <DemoLead> GetDemoLead() { demoLeadBO = new DemoLeadBO(); var obj = demoLeadBO.GetDemoLeads(); if (obj == null) { HttpResponseMessage msg = new HttpResponseMessage(HttpStatusCode.NotFound) { Content = new StringContent(string.Format("No customer with ID = {0}", 1)), ReasonPhrase = "CustomerID Not Found in Database!" }; throw new HttpResponseException(msg); } else { HttpResponseMessage msg = new HttpResponseMessage(HttpStatusCode.NotFound) { Content = new StringContent(string.Format("No customer with ID = {0}", 1)), ReasonPhrase = "CustomerID Not Found in Database!" }; throw new HttpResponseException(msg); //return obj; } }
// GET ALL DEMOLEAD public IEnumerable <DemoLead> GetDemoLead() { demoLeadBO = new DemoLeadBO(); return(demoLeadBO.GetDemoLeads()); }