GetTargetOrNull<T>(IRef<T>, ICompilation, IGenericContext?)
Gets the target of the reference for a given compilation, or returns null if the reference cannot be resolved. To get the reference for the
current execution context, use the GetTargetOrNull<T>(IRef<T>, ICompilation, IGenericContext?) extension method.
Declaration
public static T? GetTargetOrNull<T>(this IRef<T> reference, ICompilation compilation, IGenericContext? genericContext = null) where T : class, ICompilationElementParameters
| Type | Name | Description |
|---|---|---|
| IRef<T> | reference | |
| ICompilation | compilation | |
| IGenericContext | genericContext |
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T |
GetTargetOrNull(IRef, ICompilation, IGenericContext?, Type?)
Declaration
public static ICompilationElement? GetTargetOrNull(this IRef reference, ICompilation compilation, IGenericContext? genericContext = null, Type? interfaceType = null)Parameters
| Type | Name | Description |
|---|---|---|
| IRef | reference | |
| ICompilation | compilation | |
| IGenericContext | genericContext | |
| Type | interfaceType |
Returns
| Type | Description |
|---|---|
| ICompilationElement |
GetTargetOrNull<T>(IRef<T>)
Gets the target of the reference for the current execution context, or returns null if the reference cannot be resolved.
Declaration
public static T? GetTargetOrNull<T>(this IRef<T> reference) where T : class, ICompilationElementParameters
| Type | Name | Description |
|---|---|---|
| IRef<T> | reference |
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T |