Archives
-
Implementing Missing Features in Entity Framework Core – Part 2: Explicit Loading
Update: this is now implemented in Entity Framework Core 1.1: https://github.com/aspnet/EntityFramework/releases/tag/rel%2F1.1.0.
-
Implementing Missing Features in Entity Framework Core
By now, we all know that Entity Framework Core 1.0 will not include several features that we were used to. In this post, I will try to explain how we can get over this by implementing them ourselves, or, at least, working out some workaround.
-
Payloads as dynamic Objects in ASP.NET MVC
Even though the dynamic type seems to be everywhere these days, ASP.NET MVC still doesn’t support having dynamic parameters in controller action methods out of the box; which is to say, this doesn’t work as expected:
-
Detecting Default Values of Value Types
I don’t know if this happened to you: the need to find out if some instance of a class is the class’ default value. For reference types – which include nullables -, it is always null, and for value types, it is the value that you get if you do not initialize a field of that type or if you call its default parameterless constructor – false for Boolean, 0 for numbers, the 0 member of an enumeration, etc. So, the problem is, how can we tell if some instance represents this default value, dynamically, that is, for any value type, not just a specific one.
-
Encoded JavaScript in ASP.NET MVC Core
To complete the Data URI saga, here is another technique that you may find interesting: this time, it’s about encoding JavaScript contents, so as to make them more difficult to tamper with.
-
Entity Framework Pitfalls: Attaching New Entities With Existing Related Ones
One of the patterns in EF 6.x for attaching new entities to a context is to simply change it’s state to Added:
-
Fluent Validation in JavaScript
A recent discussion with my colleagues about fluent validation in JavaScript made me realize that I didn’t know of any such library. I take it for granted that some may exist, but I have never actually used one. To be clear, I mean a validation library that I can use in unit tests, for asserting conditions. Because I had a free Saturday morning, I decided to write my own!
-
Entity Framework Pitfalls: Cascade Deletes
Entity Framework supports cascading deletes for all of its associations:
-
.NET Encore
Wiktionary defines encore as “A brief extra performance, done after the main performance is complete”. Guess what, it kind of describes what .NET Core is!