public ReferencingGenerator(TableGenerator table, PropertyInfo property, ReferencingAttribute referencingAttribuite) { if (!property.PropertyType.IsGenericType) { throw new InvalidOperationException($"{nameof(ReferencingAttribute)} Property type expect generic enumerable!"); } var referenceTable = DBTable.GetTableAttributeInherit(property.PropertyType.GetGenericArguments()[0]); if (referenceTable == null) { throw new InvalidOperationException($"{nameof(ReferencingAttribute)} Property type expect {nameof(TableAttribute)}!"); } var referenceColumn = referenceTable.GetColumnByProperty(referencingAttribuite.ReferenceProperty); if (referenceColumn == null) { throw new InvalidOperationException($"{nameof(ReferencingAttribute.ReferenceProperty)} expect {nameof(ColumnAttribute)}!"); } Attribute = referencingAttribuite; Table = table; PropertyInfo = property; ReferenceTable = referenceTable; ReferenceColumn = referenceColumn; PropertyInvoker = EmitInvoker.Initialize(property, true); }
public ColumnGenerator(TableGenerator table, PropertyInfo property, ColumnAttribute columnAttribute) { Attribute = columnAttribute; Table = table; PropertyInfo = property; PropertyName = DisplayName = property.Name; ColumnName = columnAttribute.ColumnName; GroupName = columnAttribute.GroupName; }
public ReferenceGenerator(TableGenerator table, PropertyInfo property, ReferenceAttribute referenceAttribute) { Attribute = referenceAttribute; Table = table; PropertyInfo = property; ReferenceType = property.PropertyType; Column.DisplayName = property.Name; Column.Attribute.Keys |= DBColumnKeys.Reference; Column.ReferencePropertyInfo = property; GenerateName(); }
public ColumnGenerator(TableGenerator table, PropertyInfo property, ColumnAttribute columnAttribute, CultureInfo culture) { Attribute = columnAttribute; Table = table; Culture = culture; GroupName = columnAttribute.GroupName ?? columnAttribute.ColumnName; PropertyName = DisplayName = $"{property.Name}{culture.TwoLetterISOLanguageName.ToUpperInvariant()}"; PropertyInfo = property.DeclaringType.GetProperty(PropertyName) ?? property; ColumnName = $"{columnAttribute.ColumnName}_{culture.TwoLetterISOLanguageName}"; }
public LogReferenceGenerator(TableGenerator table, PropertyInfo property, LogReferenceAttribute referenceAttribute) : base(table, property, referenceAttribute) { }