Tag Archives: entityframework

Home / entityframework
30 Posts

Last night I was working on a project that had some many to many database relationships. On one side of the relationship, someone decided to use zero as the default “nothing selected” sort of key. This simply doesn’t work with Entity Framework, or probably most other .NET ORMs.

More Link

Earlier, I was dinking around with some base code I wrote for EF 6.x and recently ported over to EF Core. It’s a nice bit of code that can build LINQ expressions for nearly any search/query scenario regardless of the domain models behind the scenes. It utilizes the LINQ Expression libraries and some reflection. The code works fine in EF 6.x, but I ran into a weird issue when building expressions for many-to-many relationships.

More Link

Using .NET Core Data Protection is a bit limited. I like how it generates keys and can maintain them, but the storage mechanisms out of the box are fairly limited. Unless you’re using Redis or Azure Stoage, your only option is file system persistence. This isn’t really usable for distributed applications that need to share keys. Ideally, using a SQL server backend would be available, but it’s not too terribly difficult to create one.

More Link

At Build last week, the possibility to have global filters applied to a context opened the possibility to support multi-tenancy scenarios directly. Multi-tenancy is the concept of having specific users, or “tenants”, having access to, or ownership of, only their data. In the past, I have simply checked a user’s role and conditionally added filters. Pushing this into a global filter, though, seems a bit more practical.

More Link

In a previous post, I demonstrated a bit of code that uses Reflection to retrieve a proper materialized trace string from Entity Framework 1.1. The 2.0 preview release of EF broke that code, though.

More Link

A while back, I started looking at ways to port EF6 code, that uses a lot of the API hooks and such, to Entity Framework Core. Over the past week, I managed to port a large scale application that was using EF6 to utilize EF Core. Here are some observations/tips in continuing with my Dotnet Core porting.

More Link

I spent the better part of my development time this weekend porting various code from the .NET “full” framework to .NET Core. This included porting EntityFramework 6.1.3 code to EntityFramework Core 1.1.1. It was about as big of a pain as you would expect.

More Link

A while back, I wrote an application that processes sales information. These sales actually represent a hierarchy of data because there can be refunds, charge backs, charge backs of charge backs, refunds of refunds, adjustments, and so on and so forth. The way the data processing is handled, though, treating the entire hierarchy as a single transaction is important. This requires a bit of recursion.

More Link