Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Showing related data in the Navigation Grid
Message
De
26/11/2012 06:48:26
 
 
À
24/11/2012 10:05:15
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01557884
Message ID:
01558034
Vues:
32
>>>
>>>Maybe you'll need an anonymous object:
>>>
>>>
IQueryable<AreaEntity> query = from Area in this.ObjectContext.AreaEntitySet
>>>                                           join Route in this.ObjectContext.RouteEntitySet on Area.are_rtefk equals Route.rte_pk
>>>                                           select new{are_rtefk= Area._rtefk, rte_name = Route.rte_name};
(add other fields from Area as required)
>>
>>Thanks Viv,
>>
>>I tried that and got this error:
>>
>>
Cannot implicitly convert type 'System.Linq.IQueryable<AnonymousType#1>' to 'System.Linq.IQueryable<SamaanSystems.IBC.BusinessEF.AreaEntity>'. An explicit conversion exists (are you missing a cast?)

>
>I assume that error occurs when you try to consume the results and, yes, it's difficult to make use of anonymous types outside the procedure in which they are declared. TBH, I don't know if you can bind a grid (with auto-populate fields) to this result - I've never tried it.
>

It actually occurs at compile time.

>>One question,should Area and Route get the VS IDE formatting indicating they are defined objects/classes (light blue)? Or should they just be the normal black text?
>
>Dunno :-{ but I'd expect intellisense to work....
>
>>I am seriously leaning towards going back to using stored procedures and dumping the Entity Framework.
>
>As Pete states a SP might work best in this situation. But that doesn't mean you have to drop EF - you can add the SP to the model

I think I'll go back to working with the EF for now as I at least have one project under my belt using SPs without EF and I need to get this project moving forward.
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform