Exemplo n.º 1
0
 void PopulateGenericEventParametersFromDto(IEvent @event, EventDto eventDto)
 {
     @event.Id = eventDto.Id;
     @event.Name = eventDto.Name;
     @event.Occured = eventDto.Occurred;
     @event.Origin = eventDto.Origin;
     @event.EventSource = eventDto.EventSource;
     @event.EventSourceId = eventDto.EventSourceId;
     @event.CommandContext = eventDto.CommandContext;
     @event.CausedBy = eventDto.CausedBy;
     @event.Version = EventSourceVersion.FromCombined(eventDto.Version);
 }
Exemplo n.º 2
0
 IEvent BuildEventInstanceFromDto(EventDto eventDto)
 {
     var eventType = _eventMigrationHierarchyManager.GetConcreteTypeForLogicalEventMigrationLevel(Type.GetType(eventDto.LogicalName), eventDto.Generation);
     var @event = (IEvent)Activator.CreateInstance(eventType, eventDto.EventSourceId);
     _serializer.FromJson(@event, eventDto.Data, null);
     PopulateGenericEventParametersFromDto(@event, eventDto);
     return @event;
 }