-
Notifications
You must be signed in to change notification settings - Fork 4
Mapping Guide
Ilya Bystrov edited this page Mar 24, 2017
·
2 revisions
- Your entity class should implement ISharepointItem.
- Use attribute [SharepointList] to map your entity class to Sharepoint list. Set list name or guid.
- Use attribute [SharepointField] to map your property to Sharepoint item field. Set field Internal Name.
- For best results your property type should be compatible with Sharepoint field data type. But it is not necessary.
- To map Complex type, like FieldLookupValue or FieldUserValue, use MapData.LookupId and MapData.LookupValue. See below.
[SharepointList("Customers")]
public class SpProduct : ISharepointItem
{
[SharepointField("ID")]
public int Id { get; set; }
[SharepointField("CustomerTitleEn")]
public string Title { get; set; }
[SharepointField("RankStatus")]
public int? Rank { get; set; }
[SharepointField("CustomerCreated")]
public DateTime? Created { get; set; }
[SharepointField("NumericInfo")]
public double? SomeNumeric { get; set; }
[SharepointField("YesNoColumn")]
public bool? YesNoInfo { get; set; }
[SharepointField("Author", MapData.LookupId)]
public int AuthorId { get; set; }
[SharepointField("Author", MapData.LookupValue)]
public string Author { get; set; }
}