Sometimes it is useful to create a new object from data not stored in relational format in your database. In these cases, you can create a custom class and project linq to sql properties into it.
Here we have created an OrderDetail class (not shown) and projected into it properties from our linq to sql query. This will return a type of IQueryable(Of OrderDetail)
Dim query = from p in product _
join o in orders on p.product_id equals o.product_id _
select new OrderDetail with {
.ProductName = p.name,_
.Quantity = o.qty}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment