Exemplo n.º 1
0
 protected override void ConfigureMappings(FluentModelBuilderConfiguration configuration)
 {
     configuration.Add(
         From.AssemblyOf <EntityBase>(new TestConfiguration())
         .AddEntitiesFromAssemblyOf <EntityOneWannabe>()
         .UseOverridesFromAssemblyOf <EntityBase>()
         .UseOverridesFromAssemblyOf <EntityOneWannabe>());
 }
        public BuildingModelForSpecificContextFixture()
        {
            var services =
                new ServiceCollection();

            services
            .AddEntityFrameworkInMemoryDatabase()
            .AddDbContext <ContextOne>((p, x) => x.UseInMemoryDatabase().UseInternalServiceProvider(p))
            .AddDbContext <ContextTwo>((p, x) => x.UseInMemoryDatabase().UseInternalServiceProvider(p));
            services.ConfigureEntityFramework(From.AssemblyOf <EntityBase>(new TestConfiguration()).Context <ContextTwo>());
            var provider = services.BuildServiceProvider();

            ModelOne = provider.GetService <ContextOne>().Model;
            ModelTwo = provider.GetService <ContextTwo>().Model;
        }
 protected override void ConfigureMappings(FluentModelBuilderConfiguration configuration)
 {
     configuration.Add(
         From.AssemblyOf <EntityBase>().Where(type => type.GetTypeInfo().IsSubclassOf(typeof(EntityBase))));
 }
Exemplo n.º 4
0
 protected override void ConfigureMappings(FluentModelBuilderConfiguration configuration)
 {
     configuration.Add(
         From.AssemblyOf <EntityBase>(new TestConfiguration()).Override <SingleEntity>());
 }