public DLinqColumnProvider(DLinqTableProvider table, MetaDataMember member) : base(table) { Member = member; Name = member.Name; ColumnType = GetMemberType(member); IsPrimaryKey = member.IsPrimaryKey; IsGenerated = member.IsDbGenerated; _isAssociation = member.IsAssociation; IsCustomProperty = !member.IsAssociation && Member.DbType == null; Nullable = Member.IsAssociation ? Member.Association.IsNullable : Member.CanBeNull; MaxLength = ProcessMaxLength(ColumnType, Member.DbType); IsSortable = ProcessIsSortable(ColumnType, Member.DbType); }
private void SetOtherEndOfAssociation(MetaAssociation association) { DLinqTableProvider entityMemberParentEntity = (DLinqTableProvider)FromColumn.Table; DLinqDataModelProvider parentEntityDataContext = (DLinqDataModelProvider)entityMemberParentEntity.DataModel; if (association.OtherMember != null) { ToColumn = parentEntityDataContext.ColumnLookup[(PropertyInfo)association.OtherMember.Member]; } else { ToTable = ((DLinqDataModelProvider)FromColumn.Table.DataModel).DLinqTables.Single(tp => tp.EntityType == association.OtherType.Type); } }