Open sandboxFocus

Property WhenExists

WhenExists

Gets or sets the strategy to use when a member with the same name already exists in the target type.

Declaration
public OverrideStrategy WhenExists { get; set; }
Property Value
Type Description
OverrideStrategy
Remarks

The default value is Fail, which reports an error when a conflict is detected. Other options include:

<ul><li><xref href="Metalama.Framework.Aspects.OverrideStrategy.Override" data-throw-if-not-resolved="false"></xref>: Replace the existing member with the introduced one</li><li><xref href="Metalama.Framework.Aspects.OverrideStrategy.Ignore" data-throw-if-not-resolved="false"></xref>: Skip introducing the member without reporting an error</li><li><xref href="Metalama.Framework.Aspects.OverrideStrategy.New" data-throw-if-not-resolved="false"></xref>: Introduce the member with the <code>new</code> modifier, hiding the existing member</li></ul></p>