/// <summary> /// Reads the properties and constructor arguments from type metadata declared on this type /// </summary> protected virtual IList <IPropertyData> ReadDeclaredProperties() { IList <IPropertyData> properties = new List <IPropertyData>(); MemberInfo[] members = ForType.GetMembers(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly); foreach (MemberInfo member in members) { IPropertyData property = null; if (member is PropertyInfo) { property = CreatePropertyHandler((PropertyInfo)member); } else if (member is FieldInfo) { property = CreateFieldHandler((FieldInfo)member); } if (property != null) { properties.Add(property); property.Alias = OwningRepository.PropertyNamingStrategy.GetName(property.Name); OwningRepository.ProcessAttributes(property, member); } } return(properties); }
/// <summary> /// Reads the properties and constructor arguments from type metadata declared on this type /// </summary> /// <param name="Properties">properties collection</param> /// <param name="ConstructorArguments">constructor arguments</param> protected virtual IList <IPropertyData> ReadDeclaredProperties() { IList <IPropertyData> properties = new List <IPropertyData>(); MemberInfo[] members = ForType.GetMembers(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly); foreach (MemberInfo member in members) { IPropertyData property = null; if (member is PropertyInfo) { property = CreatePropertyHandler((PropertyInfo)member); } else if (member is FieldInfo) { property = CreateFieldHandler((FieldInfo)member); } if (property != null) { properties.Add(property); } } return(properties); }