protected Task On(AppCreated @event, EnvelopeHeaders headers) { return(Collection.CreateAsync(@event, headers, a => { SimpleMapper.Map(@event, a); })); }
void When(AppCreated e) { AppId = e.AppId; Title = e.Title; Description = e.Description; IconClass = e.IconClass; Url = e.Url; }
private void Apply(AppCreated @event) { Id = @event.AggregateRootId; Name = @event.Name; Description = @event.Description; Folder = @event.Folder; Status = AppStatus.Active; }
public void On(AppCreated @event, EnvelopeHeaders headers) { App = EntityMapper.Create <JsonAppEntity>(@event, headers, a => { SimpleMapper.Map(@event, a); a.LanguagesConfig = LanguagesConfig.Build(Language.EN); }); }
protected Task On(AppCreated @event, EnvelopeHeaders headers) { return(ForAppIdAsync(@event.AppId.Id, async collection => { await collection.Indexes.CreateOneAsync(Index.Ascending(x => x.SchemaId).Descending(x => x.LastModified)); await collection.Indexes.CreateOneAsync(Index.Ascending(x => x.ReferencedIds)); await collection.Indexes.CreateOneAsync(Index.Ascending(x => x.IsPublished)); await collection.Indexes.CreateOneAsync(Index.Text(x => x.DataText)); })); }
protected Task On(AppCreated @event, EnvelopeHeaders headers) { return(Collection.CreateAsync(@event, headers, a => { a.Clients = new Dictionary <string, MongoAppEntityClient>(); a.Contributors = new Dictionary <string, MongoAppEntityContributor>(); a.ContributorIds = new List <string>(); SimpleMapper.Map(@event, a); })); }
protected Task On(AppCreated @event, EnvelopeHeaders headers) { return(Collection.CreateAsync(@event, headers, a => { SimpleMapper.Map(@event, a); a.Clients = new AppClients(); a.Contributors = new AppContributors(); a.LanguagesConfig = LanguagesConfig.Build(Language.EN); })); }
public void Setup() { _command = new CreateApp { Id = Guid.NewGuid(), Name = "Name", Description = "Description", Folder = "Folder" }; _validatorMock = new Mock <IValidator <CreateApp> >(); _validatorMock.Setup(x => x.Validate(_command)).Returns(new ValidationResult()); _app = App.CreateNew(_command, _validatorMock.Object); _event = _app.Events.OfType <AppCreated>().SingleOrDefault(); }
public void Handle(AppCreated @event) { var repository = new Repository <Application>(this.dbContext); var app = new Application() { AppId = @event.AppId, AppSecret = @event.AppSecret, CreatedDate = @event.CreatedDate, CreatedUser = @event.CreatedUser, IsActive = @event.IsActive }; repository.Save(app); repository.SaveChanges(); }
void HandleEvent(AppCreated evt) { const string sql = @" insert into core_App(AppId, Title, Description, IconClass, Url, Sequence, DateCreated, DateUpdated, DateEnabled, DateDeleted) values (@Id, @Title, @Description, @IconClass, @Url, @Sequence, @DateCreated, @DateUpdated, @DateEnabled, @DateDeleted) ; "; DbConnection.Execute(sql, new { evt.AppId.Id, evt.Title, evt.Description, evt.IconClass, evt.Url, evt.Sequence, evt.DateCreated, evt.DateUpdated, evt.DateEnabled, evt.DateDeleted }, DbTransaction); }
protected void On(AppCreated @event) { name = @event.Name; }
protected void On(AppCreated @event) { Roles = Roles.CreateDefaults(@event.Name); SimpleMapper.Map(@event, this); }
protected void On(AppCreated @event) { SimpleMapper.Map(@event, this); }