    

 ## On this page

  

 

 # Class LinkUpdateAttribute

 Last update: 16.07.2025 

Namespace: [VM.Models.Pre](VM.Models.Pre.md)  
Assembly: VM.Models.Pre.Aspects.dll

```csharp
[Aspect(Scope.PerInstance)]
[AttributeUsage(AttributeTargets.Property, AllowMultiple = true, Inherited = true)]
[Injection(typeof(LinkUpdateAttribute))]
[Mixin(typeof(ILinkUpdateOwner))]
public class LinkUpdateAttribute : LinkBaseAttribute, ILinkUpdateOwner

```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ← [Attribute](https://learn.microsoft.com/dotnet/api/system.attribute) ← [LinkBaseAttribute](VM.Models.Pre.LinkBaseAttribute.md) ← [LinkUpdateAttribute](VM.Models.Pre.LinkUpdateAttribute.md)

#### Derived

[LinkDestroyAttribute](VM.Models.Pre.LinkDestroyAttribute.md)

#### Implements

ILinkUpdateOwner

#### Inherited Members

[LinkBaseAttribute.Dispose()](VM.Models.Pre.LinkBaseAttribute.md#VM_Models_Pre_LinkBaseAttribute_Dispose), [LinkBaseAttribute.Initialize(object)](VM.Models.Pre.LinkBaseAttribute.md#VM_Models_Pre_LinkBaseAttribute_Initialize_System_Object_), [LinkBaseAttribute.AddCache(string, IDisposable)](VM.Models.Pre.LinkBaseAttribute.md#VM_Models_Pre_LinkBaseAttribute_AddCache_System_String_System_IDisposable_), [LinkBaseAttribute.DisposeManagedResources()](VM.Models.Pre.LinkBaseAttribute.md#VM_Models_Pre_LinkBaseAttribute_DisposeManagedResources), [LinkBaseAttribute.InitializeProperty(object, IEnumerable&lt;PropertyInfo&gt;)](VM.Models.Pre.LinkBaseAttribute.md#VM_Models_Pre_LinkBaseAttribute_InitializeProperty_System_Object_System_Collections_Generic_IEnumerable_System_Reflection_PropertyInfo__), [LinkBaseAttribute.Unsubscribe(string)](VM.Models.Pre.LinkBaseAttribute.md#VM_Models_Pre_LinkBaseAttribute_Unsubscribe_System_String_), [LinkBaseAttribute.CacheItems](VM.Models.Pre.LinkBaseAttribute.md#VM_Models_Pre_LinkBaseAttribute_CacheItems), [LinkBaseAttribute.IsCacheEmpty](VM.Models.Pre.LinkBaseAttribute.md#VM_Models_Pre_LinkBaseAttribute_IsCacheEmpty)

#### Extension Methods

[LinkPropertyItemCache.GetLinkProperties(object, LinkPropertyType)](VM.Models.Pre.Cache.LinkPropertyItemCache.md#VM_Models_Pre_Cache_LinkPropertyItemCache_GetLinkProperties_System_Object_VM_Models_Pre_LinkPropertyType_), [LinkPropertyItemCache.GetLinkPropertiesAndValues(object, LinkPropertyType)](VM.Models.Pre.Cache.LinkPropertyItemCache.md#VM_Models_Pre_Cache_LinkPropertyItemCache_GetLinkPropertiesAndValues_System_Object_VM_Models_Pre_LinkPropertyType_), [LinkPropertyItemCache.GetLinkedObjects&lt;T&gt;(object, LinkPropertyType)](VM.Models.Pre.Cache.LinkPropertyItemCache.md#VM_Models_Pre_Cache_LinkPropertyItemCache_GetLinkedObjects__1_System_Object_VM_Models_Pre_LinkPropertyType_)

## Constructors

### LinkUpdateAttribute()

```csharp
public LinkUpdateAttribute()

```

### LinkUpdateAttribute(Type)

```csharp
public LinkUpdateAttribute(Type behaviorType)

```

#### Parameters

`behaviorType` [Type](https://learn.microsoft.com/dotnet/api/system.type)

### LinkUpdateAttribute(LinkBehaviorType, params string\[\])

```csharp
public LinkUpdateAttribute(LinkBehaviorType linkBehaviorType, params string[] behaviorNames)

```

#### Parameters

`linkBehaviorType` LinkBehaviorType

`behaviorNames` [string](https://learn.microsoft.com/dotnet/api/system.string)\[\]

## Fields

### \_\_a$\_instance

```csharp
public static readonly LinkUpdateAttribute __a$_instance

```

#### Field Value

[LinkUpdateAttribute](VM.Models.Pre.LinkUpdateAttribute.md)

## Properties

### AfterEventName

```csharp
protected virtual string AfterEventName { get; }

```

#### Property Value

[string](https://learn.microsoft.com/dotnet/api/system.string)

### BeforeEventName

```csharp
protected virtual string BeforeEventName { get; }

```

#### Property Value

[string](https://learn.microsoft.com/dotnet/api/system.string)

### TypeId

```csharp
public override object TypeId { get; }

```

#### Property Value

[object](https://learn.microsoft.com/dotnet/api/system.object)

## Methods

### AfterSetter(object, string, object\[\], Attribute\[\])

```csharp
[Advice(Kind.After, Targets = Target.AnyAccess|Target.Setter)]
public virtual void AfterSetter(object owner, string propertyName, object[] values, Attribute[] triggers)

```

#### Parameters

`owner` [object](https://learn.microsoft.com/dotnet/api/system.object)

`propertyName` [string](https://learn.microsoft.com/dotnet/api/system.string)

`values` [object](https://learn.microsoft.com/dotnet/api/system.object)\[\]

`triggers` [Attribute](https://learn.microsoft.com/dotnet/api/system.attribute)\[\]

### BeforeSetter(string)

```csharp
[Advice(Kind.Before, Targets = Target.AnyAccess|Target.Setter)]
public virtual void BeforeSetter(string propertyName)

```

#### Parameters

`propertyName` [string](https://learn.microsoft.com/dotnet/api/system.string)

### GetAfterBehavior&lt;TAttribute&gt;(object, string, object, EventPattern&lt;LinkEventArgs&gt;, TAttribute, bool)

```csharp
protected Action GetAfterBehavior<TAttribute>(object owner, string propertyName, object link, EventPattern<LinkEventArgs> eventPattern, TAttribute attribute, bool isSwap) where TAttribute : LinkUpdateAttribute

```

#### Parameters

`owner` [object](https://learn.microsoft.com/dotnet/api/system.object)

`propertyName` [string](https://learn.microsoft.com/dotnet/api/system.string)

`link` [object](https://learn.microsoft.com/dotnet/api/system.object)

`eventPattern` EventPattern&lt;LinkEventArgs&gt;

`attribute` TAttribute

`isSwap` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

#### Returns

[Action](https://learn.microsoft.com/dotnet/api/system.action)

#### Type Parameters

`TAttribute`

### GetAfterSubscriber&lt;TAttribute&gt;(object, string, object, TAttribute, bool)

```csharp
protected IDisposable GetAfterSubscriber<TAttribute>(object owner, string propertyName, object link, TAttribute linkAttribute, bool isSwap) where TAttribute : LinkUpdateAttribute

```

#### Parameters

`owner` [object](https://learn.microsoft.com/dotnet/api/system.object)

`propertyName` [string](https://learn.microsoft.com/dotnet/api/system.string)

`link` [object](https://learn.microsoft.com/dotnet/api/system.object)

`linkAttribute` TAttribute

`isSwap` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

#### Returns

[IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable)

#### Type Parameters

`TAttribute`

### GetBeforeBehavior&lt;TAttribute&gt;(object, string, object, EventPattern&lt;LinkEventArgs&gt;, TAttribute, bool)

```csharp
protected Action GetBeforeBehavior<TAttribute>(object owner, string propertyName, object link, EventPattern<LinkEventArgs> eventPattern, TAttribute attribute, bool isSwap) where TAttribute : LinkUpdateAttribute

```

#### Parameters

`owner` [object](https://learn.microsoft.com/dotnet/api/system.object)

`propertyName` [string](https://learn.microsoft.com/dotnet/api/system.string)

`link` [object](https://learn.microsoft.com/dotnet/api/system.object)

`eventPattern` EventPattern&lt;LinkEventArgs&gt;

`attribute` TAttribute

`isSwap` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

#### Returns

[Action](https://learn.microsoft.com/dotnet/api/system.action)

#### Type Parameters

`TAttribute`

### GetBeforeSubscriber&lt;TAttribute&gt;(object, string, object, TAttribute, bool)

```csharp
protected IDisposable GetBeforeSubscriber<TAttribute>(object owner, string propertyName, object link, TAttribute linkAttribute, bool isSwap) where TAttribute : LinkUpdateAttribute

```

#### Parameters

`owner` [object](https://learn.microsoft.com/dotnet/api/system.object)

`propertyName` [string](https://learn.microsoft.com/dotnet/api/system.string)

`link` [object](https://learn.microsoft.com/dotnet/api/system.object)

`linkAttribute` TAttribute

`isSwap` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

#### Returns

[IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable)

#### Type Parameters

`TAttribute`

### GetBehavior&lt;TAttribute&gt;(object, object, string, object, TAttribute, bool)

```csharp
protected static Action GetBehavior<TAttribute>(object caller, object owner, string propertyName, object link, TAttribute attribute, bool isSwap) where TAttribute : LinkUpdateAttribute

```

#### Parameters

`caller` [object](https://learn.microsoft.com/dotnet/api/system.object)

`owner` [object](https://learn.microsoft.com/dotnet/api/system.object)

`propertyName` [string](https://learn.microsoft.com/dotnet/api/system.string)

`link` [object](https://learn.microsoft.com/dotnet/api/system.object)

`attribute` TAttribute

`isSwap` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

#### Returns

[Action](https://learn.microsoft.com/dotnet/api/system.action)

#### Type Parameters

`TAttribute`

### GetDefaultAfterBehavior(object, EventPattern&lt;LinkEventArgs&gt;)

```csharp
protected virtual Action GetDefaultAfterBehavior(object source, EventPattern<LinkEventArgs> eventPattern)

```

#### Parameters

`source` [object](https://learn.microsoft.com/dotnet/api/system.object)

`eventPattern` EventPattern&lt;LinkEventArgs&gt;

#### Returns

[Action](https://learn.microsoft.com/dotnet/api/system.action)

### GetDefaultBeforeBehavior(object, EventPattern&lt;LinkEventArgs&gt;)

```csharp
protected virtual Action GetDefaultBeforeBehavior(object source, EventPattern<LinkEventArgs> eventPattern)

```

#### Parameters

`source` [object](https://learn.microsoft.com/dotnet/api/system.object)

`eventPattern` EventPattern&lt;LinkEventArgs&gt;

#### Returns

[Action](https://learn.microsoft.com/dotnet/api/system.action)

### InitializeProperty(object, IEnumerable&lt;PropertyInfo&gt;)

```csharp
protected override void InitializeProperty(object owner, IEnumerable<PropertyInfo> propertyInfos)

```

#### Parameters

`owner` [object](https://learn.microsoft.com/dotnet/api/system.object)

`propertyInfos` [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[PropertyInfo](https://learn.microsoft.com/dotnet/api/system.reflection.propertyinfo)&gt;

### InitializeProperty&lt;TAttribute&gt;(object, IEnumerable&lt;PropertyInfo&gt;, bool)

```csharp
protected void InitializeProperty<TAttribute>(object owner, IEnumerable<PropertyInfo> propertyInfos, bool isSwap = false) where TAttribute : LinkUpdateAttribute

```

#### Parameters

`owner` [object](https://learn.microsoft.com/dotnet/api/system.object)

`propertyInfos` [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[PropertyInfo](https://learn.microsoft.com/dotnet/api/system.reflection.propertyinfo)&gt;

`isSwap` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

#### Type Parameters

`TAttribute`

### Subscribe&lt;TAttribute&gt;(object, string, object, IEnumerable&lt;Attribute&gt;, bool)

```csharp
protected void Subscribe<TAttribute>(object owner, string propertyName, object link, IEnumerable<Attribute> attributes, bool isSwap = false) where TAttribute : LinkUpdateAttribute

```

#### Parameters

`owner` [object](https://learn.microsoft.com/dotnet/api/system.object)

`propertyName` [string](https://learn.microsoft.com/dotnet/api/system.string)

`link` [object](https://learn.microsoft.com/dotnet/api/system.object)

`attributes` [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[Attribute](https://learn.microsoft.com/dotnet/api/system.attribute)&gt;

`isSwap` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

#### Type Parameters

`TAttribute`