1
0
This repository has been archived on 2025-10-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
MapperSourceGenSample/src/MapperSourceGen/MapAliasAttribute.cs
2025-07-21 13:48:02 -04:00

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; }
}