1

Closed

LinqToOpf3 - a where expression doesn't accept an inner memberexpression

description

With using Linq To Opf3 it is not possible to add expressions that are not a simple type
 
The following code won't be compiled into a valid query by the LinqQueryCommandBuilder
 
   protected override MedewerkerInfo FetchOne(MedewerkerCriteria criteria)
   {
        var query = from medewerker in Repository.GetPersistents<MedewerkerEntity>()
                    where medewerker.MedewerkerNummer == criteria.MedewerkerNummer
                    select medewerker;

        var queryResult = query.GetObject();
        ....
 
At this moment the only workaround is to create a simple type
 
    protected override MedewerkerInfo FetchOne(MedewerkerCriteria criteria)
    {
        int medewerkerNummer = criteria.Nummer;
        var query = from medewerker in Repository.GetPersistents<MedewerkerEntity>()
                    where medewerker.MedewerkerNummer == medewerkerNummer
                    select medewerker;

        var queryResult = query.GetObject();
 
 
It would be nice not to be forced in using the workaround.
Closed Jun 18, 2010 at 1:03 PM by rfcdejong
duplicate work item, see original work item http://opf3.codeplex.com/workitem/8978

comments