Dependency Class

A use of a type by a type of the architecture, in a declaration or in the code of a method.

public sealed class Dependency

Properties

NameDescription
KindGets how the source uses the target.
LocationGets the statement that uses the target, or the start of the member for a declaration, when the PDB is available.
SourceGets the type that depends on Dependency.Target. The code of lambdas, local functions, iterators and async methods belongs to the type that declares them.
SourceMemberGets the member of Dependency.Source whose declaration or code uses Dependency.Target, or null for a dependency of the type declaration.
TargetGets the type the source depends on, without generic arguments: List<Order> gives one dependency on List<T> and one on Order.
TargetMemberGets the method or field used, for DependencyKind.MethodCall, DependencyKind.ObjectCreation and DependencyKind.FieldAccess.

Gets how the source uses the target.

public DependencyKind Kind { get; }

Property value

DependencyKind

Gets the statement that uses the target, or the start of the member for a declaration, when the PDB is available.

public SourceLocation? Location { get; }

Property value

SourceLocation?

Gets the type that depends on Dependency.Target. The code of lambdas, local functions, iterators and async methods belongs to the type that declares them.

public TypeElement Source { get; }

Property value

TypeElement

SourceMember

Dependency.cs

Gets the member of Dependency.Source whose declaration or code uses Dependency.Target, or null for a dependency of the type declaration.

public MemberElement? SourceMember { get; }

Property value

MemberElement?

Gets the type the source depends on, without generic arguments: List<Order> gives one dependency on List<T> and one on Order.

public TypeReference Target { get; }

Property value

TypeReference

TargetMember

Dependency.cs
public MemberReference? TargetMember { get; }

Property value

MemberReference?

Methods

NameDescription
ToString()Returns a description of the dependency, such as MyApp.Order.Save calls MyApp.Database.Execute (Order.cs:12:9).

ToString()

Dependency.cs

Returns a description of the dependency, such as MyApp.Order.Save calls MyApp.Database.Execute (Order.cs:12:9).

public override string ToString()

Returns

string A description of the dependency.