Development With A Dot

Blog on development in general, and specifically on .NET



My Friends

My Links

Permanent Posts

Portuguese Communities

Browse by Tags

All Tags » LINQ (RSS)
Mapping Non-Public Members With Entity Framework Code First
This is a common request, and really makes sense; we need to use LINQ expressions and a bit of reflection magic. First, an helper function for returning an expression that points to a member: 1: public static class ExpressionHelper 2: { 3: public static...
Caching LINQ Queries
Introduction Some days ago I wrote a post on comparing LINQ expressions where I shared my discoveries and general discontent on how difficult it is do right. The reason I was looking into it was because I wanted to write a LINQ query caching mechanism...
Dynamic LINQ Extension Method
Remember those old posts on Dynamic LINQ? You are probably aware that Microsoft has made its implementation available as a Nuget package , but, like I said, you already have it in your machine, hidden inside the System.Web.Extensions assembly. In order...
Posted: Jun 13 2013, 07:30 PM by Ricardo Peres | with 1 comment(s)
Filed under: ,
Comparing LINQ Expressions
Introduction I recently came upon this problem: how to calculate a hash from a LINQ expression so that I can safely compare two expressions for equality? I had naively assumed that the Expression class – and their descendants – would have implemented...
Posted: Jun 12 2013, 07:29 PM by Ricardo Peres | with 2 comment(s)
Filed under: ,
Intercepting LINQ Queries
A common request when working with LINQ queries (Entity Framework, NHibernate, etc) is the ability to intercept them, that is, inspect an existing query and possibly modify something in it. This is not extremely difficult to do “by hand”, but Microsoft...
Posted: May 23 2013, 10:03 AM by Ricardo Peres | with no comments
Filed under: ,
Querying Entity Framework Code First Inheritance
This is a short post to complement my previous one on Entity Framework Code First Inheritance : how to query for a specific class. The options are: From the DbContext collection: 1: IEnumerable<DerivedA> derived = ctx.Bases.OfType<DerivedA>...
My All Time Favorite Posts
Since this blog started, back in 2008, I wrote a lot of posts. I’d say some are still up to date. I picked a few of them, those I’m more proud of, in no particular order. ASP.NET Web Forms: Using the ASP.NET Health Monitoring Provider to Secure Your Application...
Strongly Typed Delete With NHibernate
To my great satisfaction, LINQ is nowadays present everywhere, from XML processing, to database querying, including SharePoint. The “Q” in it standing for Query , it’s not a surprise that is mainly being used for querying, but it would be interesting...
NHibernate Pitfalls: Querying Unmapped Properties With LINQ
This is part of a series of posts about NHibernate Pitfalls. See the entire collection here . Imagine you have a class like this: 1: public class Person 2: { 3: public virtual String FirstName 4: { 5: get; 6: set; 7: } 8:   9: public virtual String...
Entity Framework Code First: Get Entities From Local Cache or the Database
Entity Framework Code First makes it very easy to access local (first level) cache: you just access the DbSet<T>.Local property. This way, no query is sent to the database, only performed in already loaded entities. If you want to first search local...
More Posts Next page »