Init() public static méthode

public static Init ( IDbConnectionFactory connectionFactory ) : void
connectionFactory IDbConnectionFactory
Résultat void
        public override void Configure(Container container)
        {
            container.Register <IResourceManager>(new ConfigurationResourceManager());

            container.Register(c => new ExampleConfig(c.Resolve <IResourceManager>()));
            var appConfig = container.Resolve <ExampleConfig>();

            container.Register <IDbConnectionFactory>(c =>
                                                      new OrmLiteConnectionFactory(
                                                          ":memory:",   //Use an in-memory database instead
                                                          false,        //keep the same in-memory db connection open
                                                          SqliteOrmLiteDialectProvider.Instance));

            ConfigureDatabase.Init(container.Resolve <IDbConnectionFactory>());
        }
            public override void Configure(Container container)
            {
                container.Register <IAppSettings>(new AppSettings());

                container.Register(c => new ExampleConfig(c.Resolve <IAppSettings>()));
                //var appConfig = container.Resolve<ExampleConfig>();

                container.Register <IDbConnectionFactory>(c =>
                                                          new OrmLiteConnectionFactory(":memory:", SqliteDialect.Provider));

                Routes.Add <Movies>("/custom-movies", "GET")
                .Add <Movies>("/custom-movies/genres/{Genre}")
                .Add <Movie>("/custom-movies", "POST,PUT")
                .Add <Movie>("/custom-movies/{Id}");

                ConfigureDatabase.Init(container.Resolve <IDbConnectionFactory>());
            }
        public override void Configure(Container container)
        {
            container.Register <IResourceManager>(new ConfigurationResourceManager());

            container.Register(c => new ExampleConfig(c.Resolve <IResourceManager>()));
            var appConfig = container.Resolve <ExampleConfig>();

            container.Register <IDbConnectionFactory>(c =>
                                                      new OrmLiteConnectionFactory(
                                                          ":memory:",   //Use an in-memory database instead
                                                          false,        //keep the same in-memory db connection open
                                                          SqliteOrmLiteDialectProvider.Instance));

            Routes.Add <Movies>("/custom-movies", "GET")
            .Add <Movies>("/custom-movies/genres/{Genre}")
            .Add <Movie>("/custom-movies", "POST,PUT")
            .Add <Movie>("/custom-movies/{Id}");

            ConfigureDatabase.Init(container.Resolve <IDbConnectionFactory>());
        }
Exemple #4
0
        public object OnPost(ResetMovies request)
        {
            ConfigureDatabase.Init(TryResolve <IDbConnectionFactory>());

            return(new ResetMoviesResponse());
        }
        public override object OnPost(ResetMovies request)
        {
            ConfigureDatabase.Init(DbFactory);

            return(new ResetMoviesResponse());
        }