Пример #1
0
        public void Run()
        {
            //Database can be switched to Oracle one
            IDatabase database = new MsSqlDb();

            var userBusinessLayer = new UserBL(database);

            userBusinessLayer.Insert("AEMLoviji");
            userBusinessLayer.Get("AEMLoviji");
            userBusinessLayer.Update("AEMLoviji", "AEMLoviji2");
            userBusinessLayer.Delete("AEMLoviji2");
        }
Пример #2
0
        static void Main(string[] args)
        {
            // init config
            Config cfg = new Config();
            IConfigurationBuilder builder = new ConfigurationBuilder()
                                            .SetBasePath(Directory.GetCurrentDirectory())
                                            .AddJsonFile("config.json");

            var devEnvironmentVariable = Environment.GetEnvironmentVariable("NETCORE_ENVIRONMENT");
            var isDevelopment          = string.IsNullOrEmpty(devEnvironmentVariable) ||
                                         devEnvironmentVariable.ToLower() == "development";

            if (isDevelopment)
            {
                builder.AddUserSecrets <Program>();
            }

            IConfigurationSection configSection = builder.Build().GetSection("config");

            configSection.Bind(cfg);

            // init services
            IWiki   wiki   = new Redmine(cfg.RedmineKey, cfg.RedmineRoot);
            IMarkup markup = new TextileMarkup();

            // init DB adapters
            MsSqlDb    db  = new MsSqlDb(cfg.DbConnectionString, markup);
            GitSources git = new GitSources(cfg.GitRootPath, cfg.GitSourcesMask, markup);

            // init wiki sections
            DbObjectsList tables   = new DbObjectsList("Таблицы_AICS_AreaPassport", "table.txt");
            DbObjectsList routines = new DbObjectsList("Программы_AICS_AreaPassport", "routine.txt");

            // collect data
            db.GetTables(tables);
            db.GetRoutines(routines);
            git.AddCallers(routines);

            // save to wiki
            Task.WaitAll(
                SaveSection(tables, wiki),
                SaveSection(routines, wiki));
        }