public async Task Notify(ActDescription actDescription) { var actDescriptionChanged = new ActDescriptionChanged { actGuid = actDescription.Act.ActGuid, description = new ActDescriptionRepresentation { title = actDescription.Title, imageHash = actDescription.ImageHash, modifiedDate = actDescription.ModifiedDate } }; await publishEndpoint.Publish(actDescriptionChanged); }
public async Task Handle(ActDescriptionChanged actDescriptionChanged) { Console.WriteLine($"Updating index for act {actDescriptionChanged.description.title}."); try { string actGuid = actDescriptionChanged.actGuid.ToString().ToLower(); ActDescription actDescription = ActDescription.FromRepresentation(actDescriptionChanged.description); ActDocument act = await actUpdater.UpdateAndGetLatestAct(new ActDocument { ActGuid = actGuid, Description = actDescription }); await repository.UpdateShowsWithActDescription(actGuid, act.Description); Console.WriteLine("Succeeded"); } catch (Exception ex) { Console.WriteLine(ex.Message); throw; } }