public APIResult DeleteEvent(DeleteEventModel model) { try { if (model == null) throw new Exception("Please pass model"); using (var bo = new ApplicationBusinessObject()) { if (!bo.Check(model.ApplicationId, model.ApplicationSecretKey)) throw new Exception("Invalid application credentials"); } using (var bo = new EventBusinessObject()) { bo.Delete(model.ApplicationId, model.EventKey); } } catch (Exception ex) { return new APIResult(ex.Message, ex.ToString()); } return new APIResult(); }