Esempio n. 1
0
        public IHttpActionResult GetAll()
        {
            if (LeadRepository.DictionaryIsEmpty())
            {
                throw new HttpResponseException(HttpStatusCode.Gone);
            }

            return(Content(HttpStatusCode.OK, LeadRepository.GetAll()));
        }
Esempio n. 2
0
        public IHttpActionResult Delete(string email, string correlationId = "")
        {
            if (LeadRepository.DictionaryIsEmpty())
            {
                throw new HttpResponseException(HttpStatusCode.Gone);
            }

            if (LeadRepository.Delete(email, correlationId))
            {
                return(Ok(HttpStatusCode.OK));
            }

            else
            {
                HttpResponseMessage message = new HttpResponseMessage(HttpStatusCode.NotFound);
                message.Content = new StringContent("Oooops! the lead is not member of the dictinary.");
                throw new HttpResponseException(message);
            }
        }