Archives
-
2016 in Review
Another year is over, time to review what I did this time… so here it goes:
-
Entity Framework Core Cookbook – Second Edition
-
What’s New in .NET Core 1.1
.NET Core 1.1 – including ASP.NET Core and Entity Framework Core – was just released at the time of the Connect(); event. With it came some interesting features and improvements.
-
Interception in .NET – Part 4: An Interception Framework
This is the fourth and possibly final post on my interception in .NET series. See the last one here. This time, I’m going to present a framework for doing dynamic interception. Mind you, this is proof of concept code, it is not ready for production usage, although it can do some interesting things! This is going to be a long post, bear with me!
-
Interception in .NET – Part 3: Static Interception
Updated: see the final post in the series here.
-
Entity Framework Pitfalls: Skip/Take Position Matters
In LINQ, you normally do paging through the Skip and Take operators. These are the LINQ counterparts to whatever the relational database uses for pagination – ROW_NUMBER(), LIMIT…OFFSET, TOP, ROWNUM, etc.
-
Visual Studio Tips 4
OK, so this is another round of tips on using Visual Studio! See first collection here, second here, the third here and the fifth here.
-
Coming Up Next
Updated on October 24th
-
Entity Framework Pitfalls: Null Semantics
Imagine you have a simple class:
-
SQLPort em Aveiro
(Portuguese only, sorry!)
-
Entity Framework Pitfalls: Queries Over Navigation Properties When There Are Foreign Key Properties Are Ignored
Long title, I know!
-
Missing Features in Entity Framework Core
Updated: see my post here for info on EF Core 8.
-
Implementing Missing Features in Entity Framework Core – Part 5: Getting the SQL for a Query
Updated for EF Core 3.1
-
Unit Testing .NET Core
With the recent arrival of .NET Core, some things that we were used to having are no longer available. This includes unit tests – plus Visual Studio integration - and mocking frameworks. Fortunately, they are now becoming available, even if, in some cases, in pre-release form.
-
Moving to ASP.NET MVC Core 1
The new version of ASP.NET MVC, Core 1, brought a number of changes. Some were additions, but others were removals.The structure is similar and will be mostly familiar to anyone who has worked with ASP.NET MVC, but a few stuff is very different. Let’s visit all of them, in a lightweight way – more posts coming soon.
-
ASP.NET MVC Core: The Good Parts
MVC 6 should be out any day, so we need to be prepared.
-
Implementing Missing Features in Entity Framework Core – Part 4: Conventions
This will be the fourth in a series of posts about bringing the features that were present in Entity Framework pre-Core into EF Core. The others are:
-
.NET Core Reloaded
OK, so here’s another post on .NET Core from a non-code perspective.
-
ORMs Meet SQL – My Presentation for Tuga IT 2016
Even having been just a few hours at the Tuga IT conference, I can say that it was a huge success! So many awesome speakers, the chance to meet friends and talk about all the crazy stuff going on was great!
-
Entity Framework Pitfalls: Migrations and DbContext Construction
If you want to create or apply a migration over a DbContext-derived context and your context doesn’t have a public parameterless constructor, it will fail. This happens with both .NET Framework and .NET Core: the problem is that the migrations framework has no way of knowing how to create the context so as to get information from it, the migrations framework actually instantiates it!
-
Getting the Weather Forecast Using SharePoint Workflows
I already wrote a post on how to use SharePoint 2013 workflows. This time, I’ll get back to this topic, with a slightly more interesting (IMO) use case: a recurring workflow that runs once a day and emails users the weather forecast for the next day!
-
Elasticsearch @ NetPonto
(Portuguese only, sorry!)
-
Elasticsearch @ MVP Western Europe Community Open Day 2016
Today I presented on Elasticsearch at the MVP Western Europe Community Open Day 2016, in Rome. Apart from some problems with the magnifier tool, and taking much longer than I should , I think it went relatively well!
-
Implementing Missing Features in Entity Framework Core – Part 3: Validations
Back after a few weeks. For those who don’t know, this series of posts is dedicated to bringing some of the futures that existed in Entity Framework but were dropped in Core. You can find the first post here and the second here.
-
ASP.NET Core Inversion of Control and Dependency Injection
There are quite a few good posts out there on Inversion of Control (IoC) and Dependency Injection (DI) in the ASP.NET Core world, but I felt there was still something to be said, hence this post! Mind you, this is going to be a long one! I once wrote another post on the history of dependency resolution in .NET, you may want to have a look at it. Always keep in mind that this is based on the latest bits, and may still change when it gets to the final version.
-
Messaging Patterns with Postal.NET
Some of you may remember Postal.NET from my previous posts (here, here and here). In a nutshell, it is a framework I built for writing decoupled applications in .NET, in a publish-subscribe way. It is available as open source in GitHub (do have a look at the README file) and available in Nuget.
-
.NET Core Console Applications
Updated
-
Using MEF in .NET Core
Updated on 2018-11-08
-
Measuring Type Distance
Imagine this: you are building an API that uses conventions. A convention applies to a type. There can be several conventions registered, but the API needs to figure out what convention applies to any given class. The problem is, you can have conventions associated with base classes, concrete classes or even interfaces. For example, consider these:
-
Composition in Postal.NET
Today I pushed a new feature of Postal.NET: composition. What is this? Well, think of it as (very) lightweight sagas; a subscription is only fired when a number of messages, with certain characteristics, have been received. Let’s see some examples.
-
Changes to Postal.NET
I made a few changes to my Postal.NET library: it is now released under the LGPL license, but that’s not the most important.
-
Entity Framework Pitfalls: Entity Refresh
After an entity is loaded by Entity Framework, it gets stored in its first level cache. After that, whenever EF executes a query that returns this entity, identified by its primary key, EF always returns the cached entry, and makes no attempt to see if the cached data (the rest of the properties) is still up to date with that returned from the query. This feature is common to other ORMs, but it may result in unexpected behavior – we cannot rely on the state of a loaded entity if the database can change by other processes..
-
Introducing Postal.NET
Update: Postal.NET is now available in Nuget.
-
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!
-
Entity Framework Pitfalls: TransactionScope
Most people using Entity Framework use the TransactionScope API to manage database transactions. This is a powerful API, that can be used to enlist .NET APIs and even WS-*-compatible web services in transactions, that may well be distributed. Microsoft used to recommend it for working with EF, but isn’t doing it anymore, or, at least, developers need to understand a thing or two.
-
Inline Images in ASP.NET MVC Core
I have blogged extensively about Data URIs in the past. It allows us to render external contents inside of the page’s HTML, avoiding additional HTTP requests, but enlarging the HTML to serve. Sometimes, it does make sense, especially because the whole page can be made cacheable.
-
MVC Controller Resolver Cache
I recently faced a curious problem: I was using a third party IoC container in an MVC 5 (ASP.NET 4.*) app. In it, I had registered a service with a lifetime of transient, meaning, each resolution would return a different instance.
-
Machine Learning Week - Packt Publishing
-
Sites Portugueses Sobre Desenvolvimento de Software
Actualizado a 04/09/2020
-
2015 in Retrospective
Well, 2016 has arrived, time to look at 2015!