如果您有自定义类型,并且希望将List(T)分配给该自定义类型,那么如何在vb中执行此操作?我在下面找到了一个C#示例
List<myclass> result = (from c in db.Customers where c.orders.count > 1 Select new Myclass
{
Id = c.customerID,
Name = c.contactname
}).Tolist();
但我很难尝试让它在Vb.net中运作
答案 0 :(得分:3)
Dim result = (From c in db.Customers _
Where c.orders.Count > 1 _
Select new Myclass With { _
{
.Id = c.customerID, _
.Name = c.contactname _
}).ToList()