Beispiel #1
0
        // DELETE: api/Lookup/5
        public bool Delete(int id)
        {
            HttpRequestHeaders headers = Request.Headers;
            bool hardDelete            = false;

            if (headers.Contains("hard_delete"))
            {
                hardDelete = bool.Parse(headers.GetValues("hard_delete").First());
            }
            return(id > 0 && _contactServices.Delete(id, hardDelete));
        }
Beispiel #2
0
 public WrapResponseResult <ResponseWrapper <BaseResponse> > Delete(BaseRequest request)
 {
     return(new WrapResponseResult <ResponseWrapper <BaseResponse> >(() =>
     {
         if (request != null && ModelState.IsValid)
         {
             ResponseWrapper <BaseResponse> response = null;
             response = _contactService.Delete(request);
             return response;
         }
         else
         {
             ResponseWrapper <BaseResponse> response = null;
             response = ResponseWrapper <BaseResponse> .GetBadRequestErrorResponse();
             return response;
         }
     }, this.Request));
 }
Beispiel #3
0
 public async Task <Contact> DeleteContact(Contact contact)
 {
     return(await _contactService.Delete(contact));
 }