示例#1
0
        private static void SetupResources()
        {
            var componentRegistrar = new ComponentRegistrar(Container)
            {
                DatabaseOptionsBuilder = new DbContextOptionsBuilder <GreetingDbContext>()
                                         .UseSqlite(SqliteConnectionString)
            };

            componentRegistrar.RegisterApplicationComponents();
        }
示例#2
0
        private static void SetupResources(IConfiguration configuration)
        {
            var componentRegistrar = new ComponentRegistrar(Container)
            {
                DatabaseOptionsBuilder = DatabaseOptionsBuilderFactory
                                         .CreateDatabaseOptionsBuilder(configuration["connectionString"])
            };

            componentRegistrar.RegisterApplicationComponents(configuration);
        }