protected override void OnDeleteData(Guid entityId) { try { service.Delete(entityId); broker.Publish(CommonMessages.DeleteEggProductionSuccess, entityId); } catch (Exception ex) { var error = new Error(ex, entityId); broker.Publish(CommonMessages.DeleteEggProductionFailed, 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); }