예제 #1
0
        private GeneralRepo CreateRepo()
        {
            var connectionString = $"Data Source={fname};Compress=True;foreign keys=true;DateTimeFormat=Ticks;UTF8Encoding=True;FailIfMissing=False;";

            SqliteHelpers.EnsureCreated(connectionString);
            return(new GeneralRepo(connectionString));
        }
예제 #2
0
 public override void Load()
 {
     Bind <ILogger>().ToConstant(LogHelper.InitLog());
     Bind <IProxyProvider>().To <ProxyProvider>().InSingletonScope().WithConstructorArgument("fineproxyUrl", Config.Default.FineproxyUrl);
     Bind <UnitsProvider>().ToSelf().InSingletonScope().WithConstructorArgument("vkKeys", Config.Default.VkKeys.Cast <string>().ToArray()).WithConstructorArgument("userAgents", Config.Default.UserAgents.Cast <string>().ToArray());
     Bind <GeneralRepo>().ToMethod(z =>
     {
         var connectionString = $"Data Source={Config.Default.DBPath};Compress=True;foreign keys=false;DateTimeFormat=Ticks;UTF8Encoding=True;FailIfMissing=False;";
         if (!File.Exists(Config.Default.DBPath))
         {
             SqliteHelpers.EnsureCreated(connectionString);
         }
         return(new GeneralRepo(connectionString));
     });
     Bind <IHandleMessages <MessageExtractWallPostsCommand> >().To <HandleExtractWallPostsCommand>();
     Bind <IHandleMessages <MessageWallPostLikesRepostsComments> >().To <HandleMessageWallPostLikesRepostsComments>();
     Bind <IHandleMessages <MessageUserGet> >().To <HandleMessageUserGet>();
 }
 private FriendsFollowersSubscriptionsRepo CreateRepo()
 {
     connectionString = $"Data Source={fname};Compress=True;foreign keys=false;DateTimeFormat=Ticks;UTF8Encoding=True;FailIfMissing=False;";
     SqliteHelpers.EnsureCreated(connectionString);
     return(new FriendsFollowersSubscriptionsRepo());
 }