从文档库中检索一些项目及其中的一些字段,并以更优雅的方式分配到模型类? [英] Retrieving some items and some of their fields from a Document Library and assigin to a model class in more elegant way?

查看:63
本文介绍了从文档库中检索一些项目及其中的一些字段,并以更优雅的方式分配到模型类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用CSOM编写C#Web Api,MVC,2017年。 我想根据今天的日期取回符合特定日期要求的文档库项目。 

I'm writing C# Web Api, MVC, 2017 using CSOM.  I would like to get back the document library items that meets a certain date requirements based on today's date. 

我见过Entity Framework的例子可以使用分配的模型类来映射数据检索。 有什么类似的东西我也可以在这里做吗? 我知道我可以取回一个项目集合,然后遍历每个项目,将每个
检索到的项目的属性分配给我创建的模型类中用于保存数据的字段。 我只是想知道是否有更优雅的方式来做到这一点? 

I've seen examples of Entity Framework can use the model class assigned to map the data retrieve.  Is there something similar that I can do here as well?  I know I can get back a collection of items then loop through each of them to assign each retrieved item's property to a field in the model class that I created to hold the data.  I'm just wondering if there is a more elegant way to do this? 

谢谢

推荐答案

以下是GitHub的两个解决方案供您参考:

Here are two solutions from GitHub for your reference:

SharePoint Common

https://github.com/gdbd/sharepointcommon

SPMeta2

https:// github。 com / SubPointSolutions / spmeta2

最好的问候,

Dennis

Dennis


这篇关于从文档库中检索一些项目及其中的一些字段,并以更优雅的方式分配到模型类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆