chore: initial commit
Signed-off-by: Alan Brault <alan.brault@visus.io>
This commit is contained in:
27
src/MapperSourceGen/MapAliasAttribute.cs
Normal file
27
src/MapperSourceGen/MapAliasAttribute.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
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; }
|
||||
}
|
||||
Reference in New Issue
Block a user