namespace DealerSelection.Common.Entity; /// /// An Attribute that provides a mapping between a property on an object and a fields in a database table. /// [AttributeUsage(AttributeTargets.Property)] public sealed class FieldMapAttribute : Attribute { readonly string _dbFieldName; /// /// Initialize a new FieldMapAttribute /// /// Name of database field that this property represents public FieldMapAttribute(string dbFieldName) { _dbFieldName = dbFieldName; } /// /// Name of field that the perperty this attribute is attached to is mapped to. /// public string DbFieldName => _dbFieldName; }