Class ModelCreationAttribute
BETA / WIP: Attribute to decorate interfaces to specify a concrete type when creating the model.
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Interface, AllowMultiple = false)]
[InternalApi_DoNotUse_MayChangeWithoutNotice]
public sealed class ModelCreationAttribute : Attribute
- Inheritance
-
objectAttributeModelCreationAttribute
Examples
[ModelCreation(Use = typeof(PersonModel))]
interface IPersonModel : ICanWrapData
{
public string Name { get; }
}
Properties
Use
The type to use when creating a model of this interface.
public Type Use { get; init; }
Property Value
Remarks
It must match (implement or inherit) the type which is being decorated. Otherwise, it will throw an exception.