/// <summary>
 /// Gets the mapping's hash code
 /// </summary>
 /// <returns>Hash code for the mapping</returns>
 public override int GetHashCode()
 {
     return((TableName.GetHashCode() * DatabaseConfigType.GetHashCode()) % int.MaxValue);
 }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the
 /// <see cref="MappingBaseClass{TClassType, TDatabaseType}"/> class.
 /// </summary>
 /// <param name="tableName">Name of the table.</param>
 /// <param name="schemaName">Name of the schema.</param>
 /// <param name="suffix">The suffix.</param>
 /// <param name="prefix">The prefix.</param>
 /// <param name="order">The order.</param>
 /// <param name="merge">if set to <c>true</c> [merge] this mapping when possible.</param>
 protected MappingBaseClass(string tableName = "", string schemaName = "dbo", string suffix = "_", string prefix = "",
                            int order        = 10, bool merge = false)
 {
     SchemaName           = schemaName;
     AutoIDProperties     = new List <IAutoIDProperty>();
     IDProperties         = new List <IIDProperty>();
     Order                = order;
     Prefix               = prefix ?? string.Empty;
     Queries              = new Queries();
     ReferenceProperties  = new List <IProperty>();
     Suffix               = suffix ?? string.Empty;
     TableName            = string.IsNullOrEmpty(tableName) ? Prefix + ObjectType.Name + Suffix : tableName;
     Merge                = merge;
     MapProperties        = new List <IMapProperty>();
     ManyToManyProperties = new List <IManyToManyProperty>();
     ManyToOneProperties  = new List <IManyToOneProperty>();
     _HashCode            = TableName.GetHashCode(StringComparison.InvariantCulture) * DatabaseConfigType.GetHashCode() % int.MaxValue;
     _ToString            = ObjectType.Name;
 }