从跳转表加载相关实体
我有一个跳转表来关联客户和联系人,我想按客户名称加载所有联系人。最好的方法是什么?
Dim Q = From Cust In EnData.Customers Where Cust.CustomerID = ID Select Cust
ContactRow = Q.FirstOrDefault.CustomerToContacts.??? here I'm stock...
I have a jump table to relate the Customers and the contact, I want to load all contacts by a customer name. What is the best way to do that?
Dim Q = From Cust In EnData.Customers Where Cust.CustomerID = ID Select Cust
ContactRow = Q.FirstOrDefault.CustomerToContacts.??? here I'm stock...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个...
这应该返回一个
IQueryable
,其中包含具有所提供的custName
的客户的所有联系人。您必须将其转换为 VB,因为这是在 C# 中,尽管我认为这应该相当简单。Try this...
This should return an
IQueryable<Contact>
containing all of the contacts for the customer with the providedcustName
. You'll have to convert it to VB as this is in C#, although I assume that should be rather straight forward.