/// <summary> /// Default constructor /// </summary> /// <param name="queryMap">The query map</param> /// <param name="type">The type that contains the <see cref="PropertyInfo"/></param> /// <param name="property">The property that's getting map.</param> /// <param name="column"> /// The column. /// NOTE: The column will be <see cref="null"/> when the <see cref="PropertyInfo"/> is a navigation property! /// </param> public PropertyMap(QueryMap queryMap, Type type, PropertyInfo property, IDbProviderColumn column = null) : base() { Column = column; QueryMap = queryMap ?? throw new ArgumentNullException(nameof(queryMap)); Type = type ?? throw new ArgumentNullException(nameof(type)); PropertyInfo = property ?? throw new ArgumentNullException(nameof(property)); Table = QueryMap.Tables.First(x => x.TableName == queryMap.GetTableName(type)); }
/// <summary> /// Default constructor /// </summary> /// <param name="table">The main table</param> /// <param name="principleKeyColumn">The principle key column of the <see cref="Table"/></param> /// <param name="referencedTable">The referenced table</param> /// <param name="foreignKeyColumn">The foreign key column of the <see cref="ReferencedTable"/></param> /// <param name="index"> /// The index level of the join. /// NOTE: If the index is set to zero, then the <see cref="Table"/> is the root table! /// </param> /// <param name="isRightJoin"> /// A flag indicating whether we have a foreign key to primary key join (right join) or not. /// NOTE: When this is set to <see cref="false"/> a left join is applied (the navigation property of the root type is an <see cref="IEnumerable{T}"/>)! /// NOTE: When this is set to <see cref="true"/> a right join is applied (the navigation property of the root type is an object)! /// </param> public JoinMap(IDbProviderTable table, IDbProviderColumn principleKeyColumn, IDbProviderTable referencedTable, IDbProviderColumn foreignKeyColumn, int index, bool isRightJoin) : base() { Table = table ?? throw new ArgumentNullException(nameof(table)); PrincipleKeyColumn = principleKeyColumn ?? throw new ArgumentNullException(nameof(principleKeyColumn)); ReferencedTable = referencedTable ?? throw new ArgumentNullException(nameof(referencedTable)); ForeignKeyColumn = foreignKeyColumn ?? throw new ArgumentNullException(nameof(foreignKeyColumn)); Index = index; IsRightJoin = isRightJoin; }