DCSIMG
Expression Tree - Shimmy on .NET

Browse by Tags

All Tags » Expression Tree (RSS)

How would you check car.Finish.Style.Year.Model.Vendor.Contacts.FirstOrDefault(c=> c.Id == c.Id).FullName for null? :-) by Shimmy

Last week I blogged about how to create a strongly-typed property path ObjectQuery(T).Include with expression-trees . Not that I am the big expression tree agriculturist, no, not at all, I just discovered how powerful expression trees are and that it's a whole typed programming-language! Anyway, today I was facing another interesting issue where I had to reach a long path of objects and a part of it can be null. Consider these classes: Public Class Customer Public Property Orders As List ( Of...

Say goodbye to the hardcoded ObjectQuery(T).Include calls by Shimmy

When you want to eagerly-load navigation-properties with ADO.NET Entity-Framework, you use the ObjectQuery(T).Include method, which takes one argument 'path' typed String. I often find myself changing my database and model by adding / removing / renaming properties or other fields, and I don't realize that an exception thrown in one lonesome window is because of thes changes, all because only hard-coded strings are supported! So I decided to make my own Include implementation, and thanks...
Powered by Community Server (Commercial Edition), by Telligent Systems