예제 #1
0
        public void GetMappingCache_WhenContainsCacheSameDataReaderButDifferentConfiguration_ReturnsFalse()
        {
            var dataReader = new MockDataReader();
            var table1 = dataReader.AddTable( "Name" );
            dataReader.AddRow( table1, "" );

            var mappingCache = new MappingCache<TestClass1>( null, null );
            CacheManager.StoreMappingCache( () => mappingCache, dataReader, typeof( Configuration1 ) );

            Assert.AreEqual( mappingCache, CacheManager.GetMappingCache<TestClass1>( dataReader, typeof( Configuration1 ) ) );
        }
예제 #2
0
        public static void ConfigureDefaultSagaMaps(this ModelBuilder modelBuilder, IEnumerable <Type> sagaTypes)
        {
            foreach (var sagaType in sagaTypes)
            {
                if (!sagaType.HasInterface <ISaga>())
                {
                    throw new ArgumentException($"Type {TypeMetadataCache.GetShortName(sagaType)} does not implement {nameof(ISaga)}\'", nameof(sagaTypes));
                }

                MappingCache.Configure(modelBuilder, sagaType);
            }
        }