WAQS Querying: With on sub types (inheritance)

7 reasons to use WAQS

WAQS documentation

 

I already wrote about the With method. However, I wanted to have something equivalent to my inherited include for the With method.

So for example, imagine that we have a calculated property OrdersCount on class Customer with Customer inheriting from Person and we want to get all people with the OrdersCount property for Customers.

You can use this code:

var people = await _context.People.AsAsyncQueryable().CustomerWithOrdersCount().ExecuteAsync();
This entry was posted in 12253, 16868. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>