Class FieldAttribute
Attribute to specify mapping information for fields in data records. Can be used to define a field by its name or index, or both.
[AttributeUsage(AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false)]
public class FieldAttribute : Attribute
- Inheritance
-
FieldAttribute
- Inherited Members
- Extension Methods
Constructors
FieldAttribute()
Initializes a new instance of the FieldAttribute class without specifying a name or index.
public FieldAttribute()
FieldAttribute(int)
Initializes a new instance of the FieldAttribute class with the specified field index.
public FieldAttribute(int index)
Parameters
indexintThe index of the field in the data record.
FieldAttribute(string)
Initializes a new instance of the FieldAttribute class with the specified field name.
public FieldAttribute(string name)
Parameters
namestringThe name of the field in the data record.
FieldAttribute(string, int)
Initializes a new instance of the FieldAttribute class with both a field name and index.
public FieldAttribute(string name, int index)
Parameters
namestringThe name of the field in the data record.
indexintThe index of the field in the data record.
Properties
Index
Gets or sets the index of the field in the data record.
public int? Index { get; set; }
Property Value
- int?
Name
Gets or sets the name of the field in the data record.
public string Name { get; set; }