public void AfterConversionToEntity(string key, RavenJObject document, RavenJObject metadata, object entity) { OrderSagaData data = entity as OrderSagaData; if (data != null) { data.NumberOfItems = document["ItemCount"].Value <int>(); } }
public void AfterConversionToDocument(string key, object entity, RavenJObject document, RavenJObject metadata) { OrderSagaData data = entity as OrderSagaData; if (data != null) { document["ItemCount"] = data.NumberOfItems; } }