mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Add skeleton mapping attribute
This commit is contained in:
27
SabreTools.Models/MappingAttribute.cs
Normal file
27
SabreTools.Models/MappingAttribute.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
|
||||
namespace SabreTools.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a mapping to internal models
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Field)]
|
||||
public class MappingAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Internal name for the mapping
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Determines if the mapped value is required or not
|
||||
/// </summary>
|
||||
public bool Required { get; set; }
|
||||
|
||||
public MappingAttribute(string name, bool required = false)
|
||||
{
|
||||
this.Name = name;
|
||||
this.Required = required;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user