static void ValidateAndAddKeyProperties(DataFieldNameCollection keyProperties, Type interfaceType, IList <Type> superInterfacesType) { foreach (string propertyName in DataAttributeFacade.GetKeyPropertyNames(interfaceType)) { PropertyInfo property = interfaceType.GetProperty(propertyName); if (property == null) { foreach (Type superInterface in superInterfacesType) { property = superInterface.GetProperty(propertyName); if (property != null) { break; } } } Verify.IsNotNull(property, "Missing property '{0}' on type '{1}' or one of its interfaces".FormatWith(propertyName, interfaceType)); if (DynamicTypeReflectionFacade.IsKeyField(property)) { keyProperties.Add(propertyName, false); } } }
static void ValidateAndAddKeyProperties( DataFieldNameCollection keyProperties, DataFieldNameCollection versionKeyProperties, Type interfaceType) { foreach (string propertyName in interfaceType.GetKeyPropertyNames()) { PropertyInfo property = FindProperty(interfaceType, propertyName); if (DynamicTypeReflectionFacade.IsKeyField(property)) { keyProperties.Add(propertyName, false); } } foreach (string propertyName in interfaceType.GetVersionKeyPropertyNames()) { FindProperty(interfaceType, propertyName); versionKeyProperties.Add(propertyName, false); } }
static void ValidateAndAddKeyProperties( DataFieldNameCollection keyProperties, DataFieldNameCollection versionKeyProperties, Type interfaceType) { foreach (string propertyName in interfaceType.GetKeyPropertyNames()) { PropertyInfo property = FindProperty(interfaceType, propertyName); if (DynamicTypeReflectionFacade.IsKeyField(property)) { keyProperties.Add(propertyName, false); } } foreach (string propertyName in interfaceType.GetVersionKeyPropertyNames()) { FindProperty(interfaceType, propertyName); versionKeyProperties.Add(propertyName, false); } }
static void ValidateAndAddKeyProperties(DataFieldNameCollection keyProperties, Type interfaceType, IList<Type> superInterfacesType) { foreach (string propertyName in DataAttributeFacade.GetKeyPropertyNames(interfaceType)) { PropertyInfo property = interfaceType.GetProperty(propertyName); if (property == null) { foreach (Type superInterface in superInterfacesType) { property = superInterface.GetProperty(propertyName); if(property != null) break; } } Verify.IsNotNull(property, "Missing property '{0}' on type '{1}' or one of its interfaces".FormatWith(propertyName, interfaceType)); if (DynamicTypeReflectionFacade.IsKeyField(property)) { keyProperties.Add(propertyName, false); } } }