コード例 #1
0
ファイル: Application.cs プロジェクト: serkankaraagac/dddlib
        // TODO (Cameron): If type is in this library then don't bootstrap.
        private static AggregateRootType CreateAggregateRootType(Type type)
        {
            var typeAnalyzer         = new DefaultTypeAnalyzerService();
            var bootStrapperProvider = new DefaultBootstrapperProvider();

            return(new AggregateRootTypeFactory(typeAnalyzer, bootStrapperProvider).Create(type));
        }
コード例 #2
0
ファイル: Application.cs プロジェクト: serkankaraagac/dddlib
        private static ValueObjectType CreateValueObjectType(Type type)
        {
            var typeAnalyzer         = new DefaultTypeAnalyzerService();
            var bootStrapperProvider = new DefaultBootstrapperProvider();

            return(new ValueObjectTypeFactory(typeAnalyzer, bootStrapperProvider).Create(type));
        }
コード例 #3
0
ファイル: Application.cs プロジェクト: virajs/dddlib
        // NOTE (Cameron): Wire-up.
        static Application()
        {
            var typeAnalyzerService  = new DefaultTypeAnalyzerService();
            var bootStrapperProvider = new DefaultBootstrapperProvider();

            DefaultAggregateRootTypeFactory = new AggregateRootTypeFactory(typeAnalyzerService, bootStrapperProvider);
            DefaultEntityTypeFactory        = new EntityTypeFactory(typeAnalyzerService, bootStrapperProvider);
            DefaultValueObjectTypeFactory   = new ValueObjectTypeFactory(typeAnalyzerService, bootStrapperProvider);
        }
コード例 #4
0
        public void CanGetUninitializedFactories(Type type)
        {
            // arrange
            var typeAnalyzer = new DefaultTypeAnalyzerService();

            // act
            var uninitializedFactory = typeAnalyzer.GetUninitializedFactory(type);
            var result = uninitializedFactory.DynamicInvoke(null);

            // assert
            result.Should().NotBeNull();
            result.Should().BeOfType(type);
        }
コード例 #5
0
 public virtual void Background()
 {
     "Given a new application"
     .f(context =>
     {
         var typeAnalyzerService  = new DefaultTypeAnalyzerService();
         var bootstrapperProvider = new FeatureBootstrapperProvider();
         new Application(
             t => new AggregateRootTypeFactory(typeAnalyzerService, bootstrapperProvider).Create(t),
             t => new EntityTypeFactory(typeAnalyzerService, bootstrapperProvider).Create(t),
             t => new ValueObjectTypeFactory(typeAnalyzerService, bootstrapperProvider).Create(t))
         .Using(context);
     });
 }