Shaolinq.ComputedMemberAttribute.GetReferencedTypes C# (CSharp) Method

GetReferencedTypes() static private method

static private GetReferencedTypes ( DataAccessModelConfiguration configuration, PropertyInfo propertyInfo, Type referencedTypes ) : System.Type[]
configuration DataAccessModelConfiguration
propertyInfo System.Reflection.PropertyInfo
referencedTypes System.Type
return System.Type[]
		internal static Type[] GetReferencedTypes(DataAccessModelConfiguration configuration, PropertyInfo propertyInfo, Type[] referencedTypes)
		{
			var retval = new List<Type>();

			if (configuration.ReferencedTypes != null)
			{
				retval.AddRange(configuration.ReferencedTypes);
			}

			if (referencedTypes != null)
			{
				retval.AddRange(referencedTypes);
			}

			if (propertyInfo?.PropertyType != null)
			{
				retval.Add(propertyInfo.PropertyType);
			}

			if (propertyInfo?.DeclaringType != null)
			{
				retval.Add(propertyInfo.DeclaringType);
			}

			return retval.ToArray();
		}

Usage Example

 public LambdaExpression GetValidateLambdaExpression(DataAccessModelConfiguration configuration, PropertyInfo propertyInfo)
 {
     return(this.ValidateExpression == null ? null : ComputedExpressionParser.Parse(this.ValidateExpression, propertyInfo, ComputedMemberAttribute.GetReferencedTypes(configuration, propertyInfo, this.ReferencedTypes?.ConcatUnlessNull(this.ReferencedType).ToArray()), typeof(bool)));
 }