public AssociationWrapper(ClassWrapper foreignType, string associationName) { AssociationPartnerClass = foreignType; AssociationPartnerPrimaryKeyMember = foreignType.GetPrimaryKeyMember(); // case there is a AssociationAnnotation if (associationName != null && !associationName.Equals("")) { AssociationName = associationName; AssociationPartner = AssociationPartnerClass.GetWrappedAssociation(associationName); } }
public PropertyWrapper(ClassWrapper cw, PropertyInfo field, WrappingHandler handler) { WrappingHandler = handler; OriginalField = field; Name = CalculateFieldName(field); Size = field.HasCustomAttribute <SizeAttribute>() ? field.GetCustomAttribute <SizeAttribute>().Length : -1; DBType = handler.PropertyTypeParser.ParseFieldType(field.PropertyType, Size); IsPrimaryKey = field.HasCustomAttribute <PrimaryKeyAttribute>(); CanNotBeNull = field.HasCustomAttribute <CanNotBeNullAttribute>(); Autoincrement = field.HasCustomAttribute <AutoincrementAttribute>(); IsList = typeof(GenericList).IsAssignableFrom(field.PropertyType); DeclaringClassWrapper = cw; Association = null; }
public PropertyWrapper CreateFieldWrapper(ClassWrapper cw, PropertyInfo field) { return(new PropertyWrapper(cw, field, this)); }