public async Task <ActionResult> ReportMessage(UserMessageReportModel model) { if (!ModelState.IsValid) { return(View("ReportMessageModal", model)); } var result = await UserMessageWriter.ReportMessage(User.Identity.GetUserId(), model); return(CloseModal(result)); }
public async Task <IWriterResult> ReportMessage(string userId, UserMessageReportModel model) { try { using (var context = DataContextFactory.CreateContext()) { await Task.Delay(1).ConfigureAwait(false); return(new WriterResult(true, "This message has been reported to the site administrators, they will review and take the appropriate action.")); } } catch (Exception) { return(new WriterResult(false)); } }