Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
More complicated with Linq
Message
From
10/04/2012 21:21:42
 
 
To
All
General information
Forum:
ASP.NET
Category:
LINQ
Title:
More complicated with Linq
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01540963
Message ID:
01540963
Views:
69
I face a new syntax challenge with Linq. Lets assume this query:
                oClient = (From c
                 In oGeneric.GetClients()
                 Where c.Id = nClientID
                 Select c.FirstName,cLastName,c.Damage.Drivable).FirstOrDefault()
And, I need to use this syntax:
                oClient = (From c
                 In oGeneric.GetClients()
                 Where c.Id = nClientID
                 Select New ClientAPI.ClientService.Client() With
                 {.FirstName = c.FirstName, .LastName = c.LastName, .Something = c.Damage.Drivable}
                 ).FirstOrDefault()
The problem is with the Damage object which is being used in here in the original query. That one works. I just need to convert that query into the secondary syntax. As Damage is an object, the right part of the = part is intellisense. I can see that c.Damage shows up Drivable in the list when intellisense kicks in. However, on the left side, at the dot level, it is not really obvious how to adjust to support that.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Next
Reply
Map
View

Click here to load this message in the networking platform