/// <summary> /// Initializes a new instance of the SchemaMappingIdentity class. /// </summary> /// <param name="schemaIdentity">The identity of the schema to map to.</param> /// <param name="recordReader">The reader to use to read the objects from the stream.</param> /// <param name="mappingType">The type of mapping operation.</param> public SchemaMappingIdentity(SchemaIdentity schemaIdentity, IRecordReader recordReader, SchemaMappingType mappingType) { if (recordReader == null) { throw new ArgumentNullException("recordReader"); } // save the values away for later RecordReader = recordReader; _mappingType = mappingType; _schemaIdentity = schemaIdentity; // we know that we are going to store this in a hashtable, so pre-calculate the hashcode unchecked { // base the hashcode on the mapping type, target graph, and schema contents _hashCode = (int)_mappingType; _hashCode *= 13; _hashCode += RecordReader.GetHashCode(); _hashCode *= 13; _hashCode += schemaIdentity.GetHashCode(); } }