Example #1
0
 protected override void OnDeleteData(Guid entityId)
 {
     try
     {
         service.Delete(entityId);
         broker.Publish(CommonMessages.DeleteHenDepreciationSuccess, entityId);
     }
     catch (Exception ex)
     {
         var error = new Error(ex, entityId);
         broker.Publish(CommonMessages.DeleteHenDepreciationFailed, error);
     }
 }
        public HttpResponseMessage Delete(Guid id)
        {
            HttpResponseMessage response = null;

            try
            {
                service.Delete(id);
                response = Request.CreateResponse(HttpStatusCode.OK);
            }
            catch (Exception ex)
            {
                response = Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message);
            }

            return(response);
        }