Exemplo n.º 1
0
        public DBInfo(IDictionary dictionary)
        {
            Storage   = dictionary;
            ValueType = dictionary.GetType().GetGenericArguments().Last();
            Fields    = ValueType.GetFields().OrderBy(x => x.Name).ToDictionary(x => x.Name, x => x);

            _binders  = Fields.ToDictionary(x => x.Key, x => new FakeBinder(x.Key));
            _hashCode = new DynamicHashCode(ValueType);
        }
Exemplo n.º 2
0
        private static Stopwatch GetLeadTime(int count, DynamicHashCode baseHashCode)
        {
            var people   = new Dictionary <object, string>();
            var hashCode = new DynamicHashCode[count];

            for (var i = 0; i < count; i++)
            {
                hashCode[i] = baseHashCode.Clone();
            }

            var sw = new Stopwatch();

            sw.Start();
            foreach (var item in hashCode)
            {
                people.Add(item, "");
            }

            sw.Stop();
            return(sw);
        }