Open sandboxFocus

Method ForwardAndMarkObsolete

ForwardAndMarkObsolete(string?, bool)

Creates a ConstructorOverloadingAction that means the framework should generate a forwarding constructor and decorate it with ObsoleteAttribute so downstream callers see a deprecation warning (or error) when they use the pre-mutation signature.

Declaration
public static ConstructorOverloadingAction ForwardAndMarkObsolete(string? description = null, bool isError = false)
Parameters
Type Name Description
string description

Optional deprecation message displayed at the call site. When null, the [Obsolete] attribute is emitted without a message.

bool isError

When true, using the forwarding constructor is a compiler error instead of a warning.

Returns
Type Description
ConstructorOverloadingAction