Monthly Archives: January 2014

WAQS Querying: Avoid useless data loading using partial entity loading

7 reasons to use WAQS WAQS documentation   As I already explain in the previous post, LINQ To Entities does not support constructor in entity types. However, it could be very useful to have this feature. For example, imagine that … Continue reading

Posted in 12253, 16868, 7674 | Leave a comment

WAQS Querying: Avoid useless data loading using With method

7 reasons to use WAQS WAQS documentation   Imagine that you want to edit an order and, in your form, you want to show (read only) the customer name. In a previous post, we defined the following GetCustomerName specification method: … Continue reading

Posted in 12253, 16868, 7674 | Leave a comment

WAQS Querying: Eager loading

7 reasons to use WAQS WAQS documentation   In my audits on EF performance issues, 45% of them are caused by lazy loading and 45% are caused by Eager loading. So, as Lazy Loading, it is a major issue in … Continue reading

Posted in 12253, 16868, 7674 | Leave a comment

WAQS: Query parallelization

7 reasons to use WAQS WAQS documentation   In some cases, like ViewModel initialization, we need to execute many queries. Of course you can basically execute them sequentially but you also can execute each of them using only one HTTP … Continue reading

Posted in 16868, 7674 | Leave a comment

WAQS Querying: Lazy loading

7 reasons to use WAQS WAQS documentation   Lazy loading trap In my missions, I make a lot of audits on EF performance issues and lazy laoding is the cause of about 45% of them. The first trap about lazy-loading … Continue reading

Posted in 12253, 16868, 7674 | Leave a comment

WAQS Querying: Coalesce

7 reasons to use WAQS WAQS documentation   In SQL, navigation properties don’t exist, you don’t have NullReferenceException and result is "flat". If you use this query: context.Orders.Select(o => new { o.Id, o.OrderDetails }); the SQL result is something like … Continue reading

Posted in 12253, 16868, 7674 | Leave a comment

WAQS Querying: SQL and polymorphism

7 reasons to use WAQS WAQS documentation   In order to reproduce polymorphism logic in SQL, we can use CASE WHEN syntax. In LINQ To Entities expression, we can use something like this: c => c is VIPCustomer ? 0.1 : … Continue reading

Posted in 12253, 16868, 7674 | Leave a comment

WAQS Querying: Calculated properties and dependences

7 reasons to use WAQS WAQS documentation   You perhaps saw in the previous post, WAQS adds a partial method to change the generated expression. In the future, when L2E to L2O switching will work, you could define it to … Continue reading

Posted in 12253, 16868, 7674 | Leave a comment

WAQS: Querying on calculated properties

7 reasons to use WAQS WAQS documentation   In this post, we saw how to create a calculated property with WAQS. Base on this sample, we now have a property CustomerName on the Customer class. So, if you don’t know … Continue reading

Posted in 12253, 16868, 7674 | Leave a comment

WAQS Querying: DateTime calculation

7 reasons to use WAQS WAQS documentation   DateTime calculation with LINQ To Entities First, with the different version of LINQ To Entities, you can have some break changes with DateTime.Now. Indeed, in the past, it uses the value of … Continue reading

Posted in 12253, 16868, 7674 | Leave a comment