private void Apply(PageCreated @event) { Id = @event.AggregateRootId; SiteId = @event.SiteId; Status = @event.Status; UpdatePageDetails(@event); }
private async Task OnPageCreated(PageCreated message) { var pages = await _page.GetPagesForSection(message.SelectedSection); await DoOnUiDispatcherAsync(() => { Pages.Clear(); pages.ForEach(p => Pages.Add(p)); }); }
public void Setup() { var pageId = Guid.NewGuid(); _command = new CreatePage { SiteId = Guid.NewGuid(), Id = pageId, Name = "Name", Url = "url", Title = "Title", MetaDescription = "Meta Description", MetaKeywords = "Meta Keywords", PageLocalisations = new List <PageLocalisation> { new PageLocalisation { LanguageId = Guid.NewGuid(), Url = "url", Title = "Title", MetaDescription = "Meta Description", MetaKeywords = "Meta Keywords" } }, PagePermissions = new List <PagePermission> { new PagePermission { RoleId = Guid.NewGuid(), Type = PermissionType.View } }, MenuIds = new List <Guid> { Guid.NewGuid(), Guid.NewGuid() } }; _validatorMock = new Mock <IValidator <CreatePage> >(); _validatorMock.Setup(x => x.Validate(_command)).Returns(new ValidationResult()); _page = Page.CreateNew(_command, _validatorMock.Object); _event = _page.Events.OfType <PageCreated>().SingleOrDefault(); }
private async Task OnPageCreated(PageCreated msg) { var notebooks = await _notebook.GetNotebooks(); var selectedSection = Sections.Single(s => s.IsSelected); var updatedParentNotebook = notebooks.Single(n => n.Id == selectedSection.ParentNotebook.Id); await DoOnUiDispatcherAsync(() => { Sections.Clear(); updatedParentNotebook.Sections.ForEach(s => { if (s.Id == selectedSection.Id) { s.Select(); } Sections.Add(s); }); }); }