/// <summary> /// Creates native objects from SP list items. /// </summary> /// <typeparam name="T">Type of native object.</typeparam> /// <param name="spItems">SP list items to instantiate and map.</param> /// <param name="contentType">Content type model.</param> /// <param name="fields">Viewable fields.</param> /// <returns>Collection of native object.</returns> protected IEnumerable <T> Materialize <T>(IEnumerable <TSPListItem> spItems, MetaContentType contentType, IReadOnlyCollection <MemberRefModel> fields = null) { var mapper = contentType.GetMapper <TSPListItem>(); return(mapper.CreateAndMap <T>(spItems, fields)); }
/// <summary> /// Creates native object from SP list item. /// </summary> /// <typeparam name="T">Type of native object.</typeparam> /// <param name="spItem">SP list item to instantiate and map.</param> /// <param name="contentType">Content type model.</param> /// <param name="fields">Viewable fields.</param> /// <returns>Native object.</returns> protected T Materialize <T>(TSPListItem spItem, MetaContentType contentType, IReadOnlyCollection <MemberRefModel> fields = null) { var mapper = contentType.GetMapper <TSPListItem>(); return((T)mapper.CreateAndMap(spItem, fields)); }