Пример #1
0
 public async Task Transform(BuildContext context)
 {
     if (IDictionaryExtensions.Value(context.Build.Parameters, SCRIPT, out string script) && !String.IsNullOrEmpty(script))
     {
         using (var serviceScope = _scopeFactory.CreateScope())
         {
             var helper = serviceScope.ServiceProvider.GetRequiredService <OfficialRazorViewToStringRenderer>();
             await helper.RenderViewToStringAsync(script, context);
         }
     }
 }
Пример #2
0
        public void Initialize(IDictionary <string, object> parameters)
        {
            if (parameters != null)
            {
                if (IDictionaryExtensions.Value(parameters, "XmlPath", out string xmlPath))
                {
                    _xmlPath = xmlPath;
                }
            }

            LoadMap();
            Initialized = true;
        }
Пример #3
0
 public void Initialize(IDictionary <string, object> parameters)
 {
     Initialized = true;
     if (parameters != null)
     {
         if (IDictionaryExtensions.Value(parameters, "Name", out string name))
         {
             Name = name;
         }
         if (IDictionaryExtensions.Value(parameters, "Root", out string root))
         {
             _root = root;
         }
     }
     InitializeServices();
 }
Пример #4
0
        public void Initialize(IDictionary <string, object> paramters)
        {
            var connectionString = $"Data Source={AppPath.Relative(DB_NAME)};Version=3;";

            if (IDictionaryExtensions.Value(paramters, CONNECTION_STRING, out string connStr))
            {
                connectionString = connStr;
            }

            SqlMapper = SmartSqlMapperFactory.Create(new SmartSqlMapperFactory.CreateSmartSqlMapperOptions
            {
                Alias         = "SQLiteETLRepository",
                LoggerFactory = _loggerFactory,
                ProviderName  = "SQLite",
                SqlMapPath    = DEFAULT_SQLMAP_PATH,
                DataSource    = new DataSource
                {
                    ConnectionString = connectionString,
                    Name             = "SQLiteETL"
                }
            });
            Initialized = true;
        }