Browse by Tags
All Tags »
LINQ (
RSS)
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>...
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...
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...
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 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...
Giorgetti Alessandro, aka, Guardian, author of the blog PrimordialCode , has published recently some great posts on extending LINQ to NHibernate. You can read them here , here and here . Inspired by these posts, I set out to implement some other features...
At last! Get it from here .
How to implement basic logical operations (AND, OR, NOT, XOR) with LINQ expressions: public static class ExpressionExtensions { public static Expression<Func<T, Boolean>> Or<T>(this Expression<Func<T, Boolean>> expr, Expression<Func<T...
Updated for NHibernate Updated thanks to a comment by Samuel Jack! Thanks, Samuel! As you know, different LINQ O/RMs offer different ways to eagerly fetch associations: NHibernate offers several methods, including the HQL fetch keyword, extension method...
Continuing the Dynamic LINQ series, here are some hopefuly useful methods for performing LINQ queries in IQueryable or IQueryable<T> object, with String parameters. The available methods, so far, are: GroupBy OrderBy Skip Take WhereEquals WhereNotEquals...
More Posts
Next page »