Further Linq enhancements

Up until now there has been a problem to filter on type in Linq

The problem can be shown with this model:

o867546789076543mnvjhgcfdt

If you want to find SomeSubClass that has a Class2 with a specific name :

k;ljhgfd

But now you also get Class1’s that are not of SomeSubClass. And that is a problem in certain situations.

In Ocl2Ps we would have done:

Class2.allInstances->select(a|((a.Class1.Attribute1 = '5') and (a.Name = '5A'))).Class1->FilterOnType(SomeSubClass)

Until now MDriven Linq2Sql logic did not understand the Linq counterpart of FilterOnType – which is OfType<class>().

But now it does:

lhjk.h,gmfnds

With this is place the database takes care of all the filtering for us and returns the SomeSubClasses that has any Class2 with the correct criteria.

This page was edited 78 days ago on 02/10/2024. What links here