我们在哪里编写用于将Linnum到Sql中IEnumerable类型映射到用户定义类型的代码 [英] Where we write the code for mapping of IEnumerable type to User Defined Type in Linq to Sql

查看:76
本文介绍了我们在哪里编写用于将Linnum到Sql中IEnumerable类型映射到用户定义类型的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


请对此进行说明.

我的数据上下文在.dbml文件中具有表Employee.
这是IEnumarable类型.
现在我添加了一个Employee类.

Hi,
Please clarify this.

I my data context having Table Employee in .dbml file.
it is IEnumarable type.
now i added a class Employee.

public partial class Employee
{
}



然后我按如下方式编写查询,



then i write the queary as followes,

List<Employee> lstemp = new List<Employee>();
lstemp=MyDC.Employee.Where(a=>a.Sal>5000).tolist();




我的疑问是,
如何将其转换为用户定义的数据类型(即员工类类型)的ienumarable类型
对于此映射,我们必须检查所有代码.如果是的话,我们写的地方.

任何人都请解释一下.
我很困惑.




my doubt is,
how it convert to ienumarable type to User defined data type (i.e Employee Class type)
for this mapping we have to wright any code. if yes where we write.

Any one please explain this..
i have a lot of confusion.

推荐答案

应用LINQ后,固有类型不会丢失.
请注意,您仍然可以访问Employee 类的属性.
The inherent type is not lost after applying LINQ.
If you note, you have still been able to access properties of the Employee class.


这篇关于我们在哪里编写用于将Linnum到Sql中IEnumerable类型映射到用户定义类型的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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