// 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)); }
private static ValueObjectType CreateValueObjectType(Type type) { var typeAnalyzer = new DefaultTypeAnalyzerService(); var bootStrapperProvider = new DefaultBootstrapperProvider(); return(new ValueObjectTypeFactory(typeAnalyzer, bootStrapperProvider).Create(type)); }
// 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); }
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); }
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); }); }