public MiscellaneousHtmlTable UpdateSpecialMessage(IncomingSpecialMessage updateSpecialMessage) { var editSpecialMessage = dbContext.MiscellaneousHtmlTable.FirstOrDefault(x => x.Id == updateSpecialMessage.VenueId); if (editSpecialMessage == null) { throw new Exception("No message"); } editSpecialMessage.PageName = updateSpecialMessage.PageName; editSpecialMessage.PageData = updateSpecialMessage.PageData; //DateUpdated = DateTime.UtcNow; //add DateUpdated to the MiscellaneousHtmlTable return(editSpecialMessage); }
public HttpResponseMessage UpdateSpecialMessage(IncomingSpecialMessage updateSpecialMessage) { return(ErrorFactory.Handle(() => { using (var unitOfWork = new UnitOfWork()) { var updatedSpecialMessage = unitOfWork.Miscellaneous.UpdateSpecialMessage(updateSpecialMessage); unitOfWork.Complete(); var outgoingMiscellaneousHtml = OutgoingMiscellaneousHtml.Parse(updatedSpecialMessage); return JsonFactory.CreateJsonMessage(outgoingMiscellaneousHtml, HttpStatusCode.OK, this.Request); } }, this.Request)); }