Annotation Mapping - Happi-cat/Untech.SharePoint GitHub Wiki

Briefly

Attributes

SpFieldAttribute

Specifies member that should be mapped to existing SP Field.

Option Required Meaning
Name Optional SP field internal name. Member name is used as an Internal Name by default.
FieldType Optional SP field type as string. If it wasn't specified it will be resolved automatically.
CustomConverterType Optional Type of custom field converter that implements IFieldConverter

SpFieldRemovedAttribute

Specifies SP field that was in SP ContentType earlier but it was removed and SpField cannot be removed from member as it's in base class.

SpContentTypeAttribute

Used for describing SP ContentType and can be applied to any class. This attribute is optional and can be omited.

Option Required Meaning
Id Optional SP Content Type Id. "0x01" is used by default.
Name Optional SP Content Type name. Is not in use.

SpListAttribute

Specifies member that should be mapped to SP list. Can configure SP list url.

Option Required Meaning
Url Required Site-relative url of the SP list.

Example:

public class TestListItem
{
	[SpField]
	public virtual string Field1 { get; set; }

	[SpField]
	public virtual string Field2 { get; set; }
}