Пример #1
0
        public MappingResponse Map(string filePath, char delimiter, NameValueCollection mappings)
        {
            using (var mapper = new CsvMapper <TranslationLabel>(filePath, delimiter))
            {
                this.mappings           = mappings;
                mapper.OnItemDataBound += CsvProcessor_OnItemDataBound;
                var translationLabels = mapper.MapToClass().Skip(1).ToList();

                var response = new MappingResponse
                {
                    Results     = ReflectionUtility.GetDataTableByReflection <TranslationLabel>(translationLabels),
                    Log         = mapper.Log,
                    SqlFilePath = this.CreateSql(translationLabels)
                };

                return(response);
            }
        }