Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
More complicated with Linq
Message
De
10/04/2012 21:21:42
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
LINQ
Titre:
More complicated with Linq
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01540963
Message ID:
01540963
Vues:
70
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform