28 lines
809 B
C#
28 lines
809 B
C#
namespace MapperSourceGen;
|
|
|
|
/// <summary>
|
|
/// Specifies that the target property should appear in the domain transfer object with a different name.
|
|
/// </summary>
|
|
[AttributeUsage(AttributeTargets.Property)]
|
|
public sealed class MapAliasAttribute : Attribute
|
|
{
|
|
private MapAliasAttribute()
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="MapAliasAttribute" /> class with the specified name.
|
|
/// </summary>
|
|
/// <param name="name">The name to use instead of the property name.</param>
|
|
public MapAliasAttribute(string name)
|
|
{
|
|
ArgumentException.ThrowIfNullOrWhiteSpace(name);
|
|
Name = name;
|
|
}
|
|
|
|
/// <summary>
|
|
/// The name of the property in the domain transfer object.
|
|
/// </summary>
|
|
public string? Name { get; }
|
|
}
|