コード例 #1
0
        public void Setup()
        {
            var pageId = Guid.NewGuid();

            _command = new UpdatePageDetails
            {
                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
                    }
                }
            };
            _validatorMock = new Mock <IValidator <UpdatePageDetails> >();
            _validatorMock.Setup(x => x.Validate(_command)).Returns(new ValidationResult());
            _page = new Page();
            _page.UpdateDetails(_command, _validatorMock.Object);
            _event = _page.Events.OfType <PageDetailsUpdated>().SingleOrDefault();
        }
コード例 #2
0
 public void Handle(PageDetailsUpdated @event)
 {
     ClearPageCache(@event.SiteId, @event.AggregateRootId);
 }
コード例 #3
0
ファイル: PageEventsHandler.cs プロジェクト: ManOguaR/Weapsy
 public async Task Handle(PageDetailsUpdated @event)
 {
     await ClearPageCache(@event.SiteId, @event.AggregateRootId);
 }
コード例 #4
0
 public Task HandleAsync(PageDetailsUpdated @event)
 {
     return(ClearPageCache(@event.SiteId, @event.AggregateRootId));
 }
コード例 #5
0
ファイル: Page.cs プロジェクト: zzekikaya/Weapsy
 private void Apply(PageDetailsUpdated @event)
 {
     UpdatePageDetails(@event);
 }