简体   繁体   中英

Converting list to IEnumerable type

I have a list of files like this:

 List<ProjectFile> projectFilelist =null;
 projectFilelist = projectFileBM.GetAllProjectFileByProjectIdAndPartNum(projectID, string.Empty);

The return type in which this code has written is IEnumerable Now I wanted to retunr this list of projectFileList.

How can I convert this and return?

projectFileBM.GetAllProjectFileByProjectIdAndPartNum(projectID, string.Empty).ToList()

试试上面

set return type IEnumerable. List implements the IEnumerable interface so it is already an enumerable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM