public async Task Create(ConceptAttribute conceptAttribute, CancellationToken cancellationToken = default(CancellationToken)) { var context = await _ddpContextProvider.Get(); var conceptAttributeTable = new ConceptAttributeTable { ConceptAttributeId = conceptAttribute.ConceptAttributeId, ConceptId = conceptAttribute.ConceptId, Name = conceptAttribute.Name, }; await context.ConceptAttributeTables.AddAsync(conceptAttributeTable, cancellationToken); await _eventStore.StoreEventsFor(conceptAttribute, conceptAttribute.ConceptId, cancellationToken); await _domainEventDispatcher.QueueEvents(conceptAttribute.GetMutatingEvents()); }
public async Task Create(Domain.Domains.Domain domain, CancellationToken cancellationToken) { var context = await _ddpContextProvider.Get(); var domainTable = new DomainTable { DomainId = domain.DomainId, Name = domain.Name }; await context.DomainTables.AddAsync(domainTable, cancellationToken); await _eventStore.StoreEventsFor(domain, domain.DomainId, cancellationToken); await _domainEventDispatcher.QueueEvents(domain.GetMutatingEvents()); }