public void Delete(string year, string id) { var command = new DeleteNews { Id = Guid.Parse(id), Year = year }; Domain.Dispatcher.SendCommand(command); }
public IEnumerable Handle(Func <Guid, TournamentAggregate> al, DeleteNews command) { var tournament = CommandQueries.GetTournaments().FirstOrDefault(x => x.Year == command.Year); var agg = al(tournament.Id); yield return(new NewsDeleted { Id = tournament.Id, NewsId = command.Id, }); }
public object Delete(DeleteNews request) { var context = TepWebContext.GetWebContext(PagePrivileges.AdminOnly); try { context.Open(); context.LogInfo(this, string.Format("/news/{{Id}} DELETE Id='{0}'", request.Id)); Terradue.Portal.Article news = Terradue.Portal.Article.FromId(context, request.Id); news.Delete(); context.Close(); } catch (Exception e) { context.LogError(this, e.Message, e); context.Close(); throw e; } return(new WebResponseBool(true)); }
public IActionResult Remove(int id, [FromServices] DeleteNews deleteNews) { deleteNews.Do(id); return(RedirectToAction("Index")); }