Try our conversational search powered by Generative AI!

Class TypeReferenceAnalyzer

Analyses a type looking for properties of a specified type.

Inheritance
System.Object
TypeReferenceAnalyzer
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.DataAbstraction
Assembly: EPiServer.dll
Version: 8.11.0
Syntax
[ServiceConfiguration(typeof(TypeReferenceAnalyzer))]
public class TypeReferenceAnalyzer
Remarks

Recursively goes through the public properties of a type and searches for those of a specified typed. Will throw exception if a circular reference is encountered.

Only properties with a public get and set accessor will be validated.

Constructors

TypeReferenceAnalyzer()

Initializes a new instance of the TypeReferenceAnalyzer class.

Declaration
public TypeReferenceAnalyzer()

Methods

Analyze<T>(Type)

Analyze a type for occurrances of a specified base type

Declaration
public IEnumerable<Type> Analyze<T>(Type type)
Parameters
Type Name Description
System.Type type

The type to analyze.

Returns
Type Description
System.Collections.Generic.IEnumerable<System.Type>

The types found matching the T parameter. Ordered with the deepest matches first.

Type Parameters
Name Description
T

The public properties have to inherit from this type to be considered a match.

Remarks

Analyze a type looking for properties of a specified type. Will do so recursivly using reflection on public properties with getter and setter.

Validates if any property of a specific type creates a circular reference. Will throw an exception in that case.

Exceptions
Type Condition
System.InvalidOperationException

If circular references are found

Extension Methods