public static void Handle(Func <IEventPublisher> bus, ChangeMovieTitle msg) { // Todo: Validation var @event = new MovieTitleChanged(msg.Id, msg.Title); bus().Publish(@event); }
public void Update(MovieTitleChanged e) { _movies = _movies .Select(x => x.Id == e.Id ? MapFromEvent(e, x) : x) .ToList(); }
public static void Handle(Func <IMovieRepository> repository, MovieTitleChanged msg) { repository().Update(msg); }
private static MovieDto MapFromEvent(MovieTitleChanged e, MovieDto movieDto) { movieDto.Title = e.Title; return movieDto; }