Exemple #1
0
        public Task Update(IContainSagaData sagaData, SynchronizedStorageSession session, ContextBag context)
        {
            var versionProperty = DocumentVersionAttribute.GetProperty(sagaData);

            var classmap         = BsonClassMap.LookupClassMap(sagaData.GetType());
            var versionFieldName = GetFieldName(classmap, versionProperty.Key);

            return(_repo.Update(sagaData, versionFieldName, versionProperty.Value));
        }
Exemple #2
0
        public void Update(IContainSagaData saga)
        {
            var sagaDataType    = saga.GetType();
            var versionProperty = DocumentVersionAttribute.GetDocumentVersionProperty(sagaDataType);
            var version         = (int)versionProperty.GetValue(saga);

            var classmap         = BsonClassMap.LookupClassMap(sagaDataType);
            var versionFieldName = GetFieldName(classmap, versionProperty.Name);

            _repo.Update(saga, versionFieldName, version);
        }