Thursday, March 10, 2011

SharePoint SPMetal + CreatedBy, Created

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"); } } }


DateTime _Created;
[Microsoft.SharePoint.Linq.ColumnAttribute(Name = "Created", Storage = "_Created", ReadOnly = true, FieldType = "DateTime", IsLookupValue = false)]
public DateTime Created { get { return this._Created; } set { if ((value != this._Created)) { this.OnPropertyChanging("Created", this._Created); this._Created = value; this.OnPropertyChanged("Created"); } } }


1 Name="Editor" Member="ModifiedBy"
2 Name="Author" Member="CreatedBy"
3 Name="Created"
4 Name="Modified"

No comments:

Post a Comment