C# Класс Ncqrs.Eventing.Storage.PropertyBagConverter

Converts an IEvent from/to a flattened structure suitable for storing in an IEventStore.
Наследование: IPropertyBagConverter
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AddPostConversion ( Type targetType, IPropertyBagPostConverter converter ) : void

Adds a custom converter that resolves differences when converting an event or command with an earlier schema.

Convert ( object obj ) : PropertyBag

Converts a command or event into a property bag.

Convert ( PropertyBag propertyBag ) : object

Converts a command or event stored as a property bag back to its object representation.

If a post conversion was registered using AddPostConversion, it will be invoked after the default conversion has completed. Moreover, the actual type created can be overridden by providing a custom IPropertyBagTypeResolver through the TypeResolver property.

Приватные методы

Метод Описание
CreateInstanceOfType ( Type targetType ) : object
GetDestinationType ( PropertyBag bag ) : Type
InitializeInstancePropertiesFrom ( PropertyBag bag, object target ) : bool
InvokePostConverter ( object instance, PropertyBag bag ) : bool
IsPropertyWritable ( PropertyInfo propertyInfo ) : bool
RequiresConversion ( PropertyInfo targetProperty, object value ) : bool
SetPropertyValue ( object instance, PropertyInfo targetProperty, object value ) : bool

Описание методов

AddPostConversion() публичный Метод

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.
Результат void

Convert() публичный Метод

Converts a command or event into a property bag.
public Convert ( object obj ) : PropertyBag
obj object
Результат PropertyBag

Convert() публичный Метод

Converts a command or event stored as a property bag back to its object representation.
If a post conversion was registered using AddPostConversion, it will be invoked after the default conversion has completed. Moreover, the actual type created can be overridden by providing a custom IPropertyBagTypeResolver through the TypeResolver property.
public Convert ( PropertyBag propertyBag ) : object
propertyBag PropertyBag
Результат object