【发布时间】:2017-11-30 08:44:23
【问题描述】:
public IEnumerable<Project> Get(int id)
{
DataTable dt = new DataTable();
Project_BL projbl = new Project_BL();
dt = projbl.SelectprojectModelBasedProjectID(id);
var tag = dt.AsEnumerable().Select(x => new TAGS
{
tag_id = x.Field<int>("tag_id"),
tag_name = x.Field<string>("tag_name")
// like wise initialize properties here
});
return tag;
}
这里,Ienumerable<Project>,Project 是一个类。我想在那里添加另一个类。同样在var tag = dt.AsEnumerable().Select(x => new Project,
这里我也想添加多个类
【问题讨论】:
-
你想达到什么目的?
-
如何在 var tag = dt.AsEnumerable().Select(x => new TAGS line also 中实现
标签: c# asp.net-web-api