コード例 #1
0
ファイル: ETLService.cs プロジェクト: RazaToosy/CsvMapper
 public ModelDataContainer Transform(IEnumerable<ModelMap> maps, ModelDataContainer items)
 {
     return  DataRepository.Transform(maps,items);
 }
コード例 #2
0
ファイル: MainViewModel.cs プロジェクト: RazaToosy/CsvMapper
        public void DoExport()
        {
            try
            {
                ResultsViewContent += "\nCreating Export...";
                //Create ETL Layer
                string xmlFile =
                    Path.Combine(new FileInfo(System.Reflection.Assembly.GetEntryAssembly().Location).Directory.FullName,
                        string.Format("{0}.xml", Path.GetFileNameWithoutExtension(_inputFileLocation)));
                var service = new RepositoryData();
                var theContainer = new ModelDataContainer();

                //Extract
                theContainer = service.DataRepository.Create(this._inputFileLocation, new RepositoryMaps(xmlFile).Maps);

                //Transform
                theContainer = service.DataRepository.Transform(new RepositoryMaps(xmlFile).Maps, theContainer);

                //Load
                service.DataRepository.Save(Path.Combine(
                    Environment.GetFolderPath(Environment.SpecialFolder.Desktop),
                    string.Format("{0}.Output.csv", Path.GetFileNameWithoutExtension(_inputFileLocation))),
                    theContainer);

                ResultsViewContent += "\nOutput exported to the Desktop...";
            }
            catch (Exception ex)
            {
                LoggerSingleton.Instance.LogMessage(ex);
            }
        }
コード例 #3
0
ファイル: ETLService.cs プロジェクト: RazaToosy/CsvMapper
 public void Save(string destination, ModelDataContainer items)
 {
     DataRepository.Save(destination,items);
 }
コード例 #4
0
 public CsvModelDataContainerExport(ModelDataContainer theContainer)
 {
     _theContainer = theContainer;
 }