コード例 #1
0
        Nancy.Response DeleteNotification(string id)
        {
            try {
                NotificationMapper not_mpr      = new NotificationMapper();
                NotificationModel  notification = not_mpr.GetById(id);

                if (notification == null)
                {
                    return(ErrorBuilder.ErrorResponse(this.Request.Url.ToString(), "GET", HttpStatusCode.NotFound, String.Format("A notification with Id = {0} does not exist", id)));
                }

                not_mpr.delete(notification);

                return(HttpStatusCode.OK);
            } catch (Exception e) {
                return(HandleException(e, String.Format("\nNotificationModule.Delete({0})", id)));
            }
        }