Browse by Tags
All Tags »
Entity Framework Code First (
RSS)
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 mechanism, which is exactly why I am writing this! I will be...
Introduction Most 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 characters”, etc. This typically includes individual properties...
Introduction In some O/RMs, it is possible to specify automatic filters for entity collections such as one-to-many or many-to-many. These are applied automatically whenever these collections are being populated. Entity Framework does not offer one such...
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>...
Introduction Another post for self reference, this time, how to map inheritance strategies with Entity Framework Code First. Single Table Inheritance / Table Per Class Hierarchy First, the default strategy: one table for all classes in the hierarchy....
Introduction This post is more for self-reference than anything else. Basically, I tend to forget some options for mapping relations with Entity Framework Code First, so I wrote this. If in doing so it helps someone, even better! One-to-Many First, the...
Introduction NHibernate and Entity Framework are two of the most popular O/RM frameworks on the .NET world. Although they share some functionality, there are some aspects on which they are quite different. This post will describe this differences and...
One thing I didn’t refer on my previous post on ASP.NET MVC CRUD with AJAX was how to retrieve model validation information into the client. We want to send any model validation errors to the client in the JSON object that contains the ProductId , RowVersion...
I know that I have not posted much on MVC, mostly because I don’t use it on my daily life, but since I find it so interesting, and since it is gaining such popularity, I will be talking about it much more. This time, it’s about the most basic of scenarios...
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 »