AddPostConversion() public méthode

Adds a custom converter that resolves differences when converting an event or command with an earlier schema.
public AddPostConversion ( Type targetType, IPropertyBagPostConverter converter ) : void
targetType System.Type The type of command or event for which to a add custom post conversion.
converter IPropertyBagPostConverter The converter object that will resolve the differences.
Résultat void
Exemple #1
0
        private static IEventStore InitializeEventStore()
        {
            var converter = new PropertyBagConverter();
            converter.TypeResolver = new AppV2EventsTypeResolver();

            converter.AddPostConversion(typeof(NameChangedEvent), new NameChangedEventPostConverter());
            converter.AddPostConversion(typeof(PersonCreatedEvent), new PersonCreatedEventPostConverter());

            var eventStore = new MsSqlServerEventStore("Data Source=.\\sqlexpress; Initial Catalog=VersioningEventStore; Integrated Security=SSPI;", converter);
            return eventStore;
        }