SPListItem Extension Methods


T Field<T>(string name)
T Field<T>(Guid id)
Converts a field on the SPListItem to the preferred type.
SPListItem item = GetListItemCode();

string title = item.Field<string>("Title");
Nullable<DateTime> optionaldate = item.Field<Nullable<DateTime>>("somedate");

Last edited Feb 19, 2010 at 12:46 PM by jole, version 2

Comments

No comments yet.