public string[] CreateTypeAttributes(IPropertyBase property, IPropertiesBuilder propertiesBuilder) { if (this.ActiveDTOStage) { return(new string[0]); } IEnumerable <IOrmAttribute> typeAttributes = null; if (propertiesBuilder != null) { typeAttributes = propertiesBuilder.GetPropertyTypeAttributes(property); property = propertiesBuilder.GetProperty(property, InheritanceMember.Inherited); } if (typeAttributes == null) { typeAttributes = property.TypeAttributes; } ITypeAttributesBuilder attributesBuilder = TypeAttributesBuilder.Create(property, typeAttributes); return(CreateTypeAttributes(attributesBuilder, typeAttributes)); }
public string[] CreateTypeAttributes(IPersistentType persistentType, IPropertiesBuilder propertiesBuilder) { if (this.ActiveDTOStage) { return(new string[0]); } IEnumerable <IOrmAttribute> typeAttributes = null; if (propertiesBuilder != null) { typeAttributes = propertiesBuilder.MergedTypeAttributes; } if (typeAttributes == null) { typeAttributes = persistentType.TypeAttributes; } ITypeAttributesBuilder attributesBuilder = TypeAttributesBuilder.Create(persistentType, typeAttributes); string[] extraAttributes = persistentType.TypeKind == PersistentTypeKind.Interface ? new string[0] : new string[] { ATTRIBUTE_SERIALIZABLE }; return(CreateTypeAttributes(attributesBuilder, typeAttributes.ToArray()).Concat(extraAttributes).ToArray()); }