Exemplo n.º 1
0
        public PropertyToValueCorrelation[] GetPropertiesValuesFairWithoutLinq(string rawData)
        {
            var result     = new List <PropertyToValueCorrelation>();
            var mailPairs  = DefaultRawStringParser.ParseFairWithoutLinq(rawData: rawData, pairDelimiter: Environment.NewLine);
            var mapSchemas = _mapSchemas;

            foreach (var item in mapSchemas)
            {
                if (item.EntityName.ToUpperInvariant() != _typeNameInUpperCaseInvariant)
                {
                    continue;
                }

                foreach (var pair in mailPairs)
                {
                    if (!pair.Key.Equals(item.Key, StringComparison.InvariantCultureIgnoreCase))
                    {
                        continue;
                    }

                    result.Add(new PropertyToValueCorrelation {
                        PropertyName = item.Property, Value = pair.Value
                    });
                }
            }
            return(result.ToArray());
        }
Exemplo n.º 2
0
        public IEnumerable <PropertyToValueCorrelation> GetPropertiesValues2(string rawData)
        {
            var mailPairs  = DefaultRawStringParser.ParseWithLinq2(rawData: rawData, pairDelimiter: Environment.NewLine);
            var mapSchemas =
                _mapSchemas
                .Where(x => x.EntityName.ToUpperInvariant() == _typeNameInUpperCaseInvariant)
                .Select(x => new { x.Key, x.Property });

            return
                (mailPairs
                 .Join(mapSchemas, x => x.Key, x => x.Key,
                       (x, y) => new PropertyToValueCorrelation {
                PropertyName = y.Property, Value = x.Value
            }));
        }
Exemplo n.º 3
0
        public PropertyToValueCorrelation[] GetPropertiesValuesFair(string rawData)
        {
            List <KeyValuePair <string, string> > mailPairs = DefaultRawStringParser.ParseFairWithLinq(rawData: rawData, pairDelimiter: Environment.NewLine);
            var mapSchemas =
                _mapSchemas
                .Where(x => x.EntityName.ToUpperInvariant() == _typeNameInUpperCaseInvariant)
                .Select(x => new { x.Key, x.Property })
                .ToArray();

            return
                (mailPairs
                 .Join(mapSchemas, x => x.Key, x => x.Key,
                       (x, y) => new PropertyToValueCorrelation {
                PropertyName = y.Property, Value = x.Value
            })
                 .ToArray());
        }