LINQ To SharePint 缺失Created By/Modified By 字段

微软你做事能细心点吗?

使用Linq to SharePoint,结果产生出来的实体类,居然找不到创建者、修改者这样的字段。要么说默认自带的这些字段都找不到就算了,可是版本、路径这些垃圾字段倒显示出来。

只有再琢磨一番。

找到Item 这个类,添加以下代码

string _CreatedBy;
[Microsoft.SharePoint.Linq.ColumnAttribute(Name = "Author", Storage = "_CreatedBy", ReadOnly = true, FieldType = "User", IsLookupValue = true)]
public string CreatedBy
{
get { return this._CreatedBy; }
set {
if ((value != this._CreatedBy))
{
this.OnPropertyChanging("CreatedBy", this._CreatedBy);
this._CreatedBy = value;
this.OnPropertyChanged("CreatedBy");
}
}
}

修改者的字段可以类似的修改下。

原文地址:https://www.cnblogs.com/windy2008/p/2299752.html