Using the Enterprise Library 6 Configuration Console with Visual Studio 2012
You will have to download and run the Configuration Console from http://www.microsoft.com/en-us/download/details.aspx?id=38789, there is no NuGet package for it. After that, you will get a context menu...
View ArticleBlogs Portugueses Sobre SharePoint
This post is in portuguese only, sorry!A partir de um comentário no LinkedIn, no grupo da Comunidade Portuguesa de SharePoint (http://www.linkedin.com/groups?home=&gid=996587&trk=anet_ug_hm)...
View ArticleEntity Framework Code First Validation
IntroductionMost persistence frameworks implement some kind of custom validation of entities before they are sent to the database. By custom I mean something more than just “is not null”, “has XX...
View ArticleEntity Framework Code First Fluent Validation
Back to Entity Framework Code First (EFCF) validation. On my previous post I mentioned that EFCF did not support fluent validation. While this is true, it isn’t too hard to implement one such...
View ArticleIntercepting 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...
View ArticleThe State of Entity Framework and NHibernate
Some time ago, I compared NHibernate and Entity Framework. It was from a very technical point of view, and I think it is still up to date. Today, I want to talk about the current state of things, from...
View ArticleUnity – Part 4: Extensions
ExtensionsAnother long overdue post on Unity. See the first here for an introduction, the second here for dependency injection and the third here for AOP with Unity.Unity allows adding extensions to...
View ArticleEntity Framework Metadata
Sometimes it is useful to know something about the physical storage of a code first model. Maybe it’s for SQL reporting or for any other matter, I sometimes have the need to look up the table name...
View ArticleComparing LINQ Expressions
IntroductionI 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...
View ArticleDynamic LINQ Extension Method
Remember those oldposts 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...
View ArticleNHibernate Conventions
IntroductionIt seems that nowadays everyone loves conventions! Not the ones that you go to, but the ones that you use, that is! It just happens that NHibernate also supports conventions, and we’ll see...
View ArticleUnity – Part 5: Injecting Values
IntroductionThis is the fifth post on Unity. You can find the introductory post here, the second post, on dependency injection here, a third one on Aspect Oriented Programming (AOP) here and the latest...
View ArticlePluggable Rules for Entity Framework Code First
Suppose you want a system that lets you plug custom validation rules on your Entity Framework context. The rules would control whether an entity can be saved, updated or deleted, and would be...
View ArticleMy View on ASP.NET Web Forms versus MVC
IntroductionA lot has been said on Web Forms and MVC, but since I was recently asked about my opinion on the subject, here it is.First, I have to say that I really like both technologies and I don’t...
View ArticleProfiling Entity Framework Code First With MiniProfiler
Updated: thanks, RichardD!IntroductionWhen I tried to find an up to date tutorial on using MiniProfiler with Entity Framework Code First I couldn’t find any that I could use – all either referred old...
View ArticleInstant StyleCop Code Analysis How-to Review
In the past days I’ve been reading Instant StyleCop Code Analysis How-to. Having interest in static code analysis, I have always been interested in StyleCop and FxCop, Microsoft’s static analysis...
View ArticleMapping 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:...
View ArticleEntity Framework Pitfalls – Validation Does Not Load Lazy Properties
In a nutshell: Entity Framework Code First (EFCF) validation does not load lazy properties. If any of these properties is marked as required, and it is not loaded, a validation error will occur.While I...
View ArticleEntity Framework Pitfalls – Migrations Require .NET 4.5
Updated on 28-08: not sure how this problem appeared, but apparently this no longer happens.If you are to use Entity Framework Code First Migrations, you need to have your project set to use .NET 4.5,...
View ArticleEntity Framework Code First Table Splitting
Since Entity Framework does not support lazy scalar properties, only lazy references and collections, in order to avoid automatic loading of columns with large contents – BLOBs or CLOBs – we can use a...
View Article