示例#1
0
        public IndexFieldsCacheKey(IDataReader reader, ModelDefinition modelDefinition, IOrmLiteDialectProvider dialect)
        {
            ModelDefinition = modelDefinition;
            Dialect         = dialect;

            int startPos = 0;
            int endPos   = reader.FieldCount;

            Fields = new List <string>(endPos - startPos);

            for (int i = startPos; i < endPos; i++)
            {
                Fields.Add(reader.GetName(i));
            }

            unchecked
            {
                hashCode = 17;
                hashCode = hashCode * 23 + ModelDefinition.GetHashCode();
                hashCode = hashCode * 23 + Dialect.GetHashCode();
                hashCode = hashCode * 23 + Fields.Count;
                for (int i = 0; i < Fields.Count; i++)
                {
                    hashCode = hashCode * 23 + Fields[i].Length;
                }
            }
        }