You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
755 B
24 lines
755 B
namespace DealerSelection.Common.Entity;
|
|
|
|
/// <summary>
|
|
/// An Attribute that provides a mapping between a property on an object and a fields in a database table.
|
|
/// </summary>
|
|
[AttributeUsage(AttributeTargets.Property)]
|
|
public sealed class FieldMapAttribute : Attribute
|
|
{
|
|
readonly string _dbFieldName;
|
|
|
|
/// <summary>
|
|
/// Initialize a new FieldMapAttribute
|
|
/// </summary>
|
|
/// <param name="dbFieldName">Name of database field that this property represents</param>
|
|
public FieldMapAttribute(string dbFieldName)
|
|
{
|
|
_dbFieldName = dbFieldName;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Name of field that the perperty this attribute is attached to is mapped to.
|
|
/// </summary>
|
|
public string DbFieldName => _dbFieldName;
|
|
}
|