/// <summary> /// Adds a dictionary data model the the data models aggregator. /// </summary> /// <param name="aggregator">The data models aggregator.</param> /// <param name="modelConfiguration">The dictionary data model configuration.</param> /// <param name="namespaceName">The namespace name of data model structures.</param> public static void AddDictionaryModel(this IDataModelAggregator aggregator, Action <IDictionaryModelConfiguration> modelConfiguration, string namespaceName) { Dictionary <string, IDataStructure> dataStructures = new Dictionary <string, IDataStructure>(); modelConfiguration(new DictionaryModelConfiguration(dataStructures)); IDataModelProvider dataModel = new DictionaryDataModelProvider(aggregator, namespaceName, dataStructures); aggregator.DataModelsCollection.Add(dataModel); }
/// <summary> /// Add a TSQL model to the data models aggregator. /// </summary> /// <param name="aggregator">The data models aggregator.</param> /// <param name="connectionString">The TSQL database connection string.</param> public static void AddSqlServerModel(this IDataModelAggregator aggregator, string connectionString) { IDataModelProvider dataModel = new SqlServerDataModelProvider( aggregator, (compName, compType, dataType) => { return(new DataStructure()); }, connectionString, aggregator.EnvironmentMapper); aggregator.DataModelsCollection.Add(dataModel); }
public TranslationService(ILogger <TranslationService> logger, ITreeGenerator treeGenerator, ISchemaModifiersApplier schemaModifiersApplier, IEnumerable <ILoggerProvider> loggerProviders, IEnumerable <ITargetRenderer> targetRenderers, IDataModelAggregator dataModelAggregator) { this._logger = logger; this._treeGenerator = treeGenerator; this._schemaModifiersApplier = schemaModifiersApplier; this._errorCollectorProvider = (ErrorCollectorProvider)loggerProviders.SingleOrDefault(l => l.GetType() == typeof(ErrorCollectorProvider)); this._dataModelAggregator = dataModelAggregator; this._targetRenderers = targetRenderers; }
public TranslationService(ILogger <TranslationService> logger, ITreeGenerator treeGenerator, ISchemaModifiersApplier schemaModifiersApplier, IEnumerable <ILoggerProvider> loggerProviders, IEnumerable <ITargetRenderer> targetRenderers, IDataModelAggregator dataModelAggregator, IEnvironmentMapper mapper) { this.logger = logger; this.treeGenerator = treeGenerator; this.schemaModifiersApplier = schemaModifiersApplier; this.dataModelAggregator = dataModelAggregator; this.mapper = mapper; this.targetRenderers = targetRenderers; }
/// <summary> /// Adds the VtlProcessing services collection. /// </summary> /// <param name="services">The service collection to add the VtlProcessing services collection to.</param> /// <param name="config">The configuration of a VtlProcessing VTL 2.0 translator.</param> /// <returns>The service collection.</returns> public static IServiceCollection AddVtlProcessing(this IServiceCollection services, Action <IVtlProcessingConfig> config) { IVtlProcessingConfig configuration = new VtlProcessingConfig(); if (config != null) { config(configuration); } IDataModelAggregator dataModelAggregator = configuration.DataModels; services.AddVtlProcessing(configuration.RemoveDeadCode); services.AddScoped(p => dataModelAggregator); services.AddScoped <IDataModelProvider>(p => dataModelAggregator); services.AddScoped(p => configuration.EnvironmentMapper); return(services); }
/// <summary> /// Initializes a new instance of the <see cref="EnvironmentMapper"/> class. /// </summary> /// <param name="dataModelAggregator">The data models aggregator.</param> public EnvironmentMapper(IDataModelAggregator dataModelAggregator) { this._dataModelAggregator = dataModelAggregator; this.Mapping = new Dictionary <string, string>(); this.DefaultTargetPrefix = string.Empty; }
/// <summary> /// Adds a SDMX data model to the data models aggregator. /// </summary> /// <param name="aggregator">The data models aggregator.</param> /// <param name="url">The SDMX model url address.</param> /// <param name="namespaceName">The namespace name of data model structures.</param> public static void AddSdmxModel(this IDataModelAggregator aggregator, string url, string namespaceName) { IDataModelProvider dataModel = new SdmxDataModelProvider(aggregator, namespaceName, url); aggregator.DataModelsCollection.Add(dataModel); }
/// <summary> /// Adds a JSON model to the data models aggregator. /// </summary> /// <param name="aggregator">The data models aggregator.</param> /// <param name="filePath">The file path of JSON file.</param> public static void AddJsonModel(this IDataModelAggregator aggregator, string filePath) { aggregator.DataModelsCollection.Add(new JsonDataModelProvider(aggregator, filePath)); }