The ExceptResultOperator result operator is not current supported

373 Views Asked by At

I want to exclude one resultset from another and I am using Except for that but it is giving error that "The ExceptResultOperator result operator is not current supported". I can not use all the conditions in where clause of a single query as it will give me unexcepted result.

//Sample code what I have tried

 var result1 = Session.Query<Table>()
                .Where(x => x.ColumnName != null && !x.active)
                .Select(x => x)

   var result2 = Session.Query<Table>()
                .Where(x => x.Active)
                .Except(result1)
                .Select(x => x)
1

There are 1 best solutions below

0
Roman Artiukhin On BEST ANSWER

You can use Contains instead of Except:

 var result1 = Session.Query<Table>()
                .Where(x => x.ColumnName != null && !x.active)
                .Select(x => x)

 var result2 = Session.Query<Table>()
                .Where(x => x.Active && !result1.Contains(x))
                .Select(x => x)