To get information about an object, I mostly overload the
ToString method to display information in the local debug or the popup window. Then I found out that there is another way.
Continue reading “Use DebuggerDisplayAttribute to make your life easier”
While optimising a query, I noticed that a many-to-many relationship still used a class in between. There is a more optimised way to configure many-to-many relationships in Entity Framework.
Continue reading “Entity Framework many-to-many relationship”
Last week, I wrote about the program that will read the emails from my Outlook account. This week I’ll grant the application read rights so that it can actually read the emails.
Continue reading “Connecting to Office365 by API: the setup”
At work, we made the switch from a local mail server that was accessed over POP3 and IMAP to Office365 Outlook which we access through their RESTful API. To learn more about how this works, I tried to duplicate this process so I can access my personal Outlook emails via a console application.
Continue reading “Connecting to Office365 by API: the code”
A trend I see in code that gets written by friends and coworkers is that every class needs to be injected. They all look so surprised when I tell them that they don’t have to do that with every class they need. Then they always follow up with: then why do we need a dependency injection (DI) framework?
Continue reading “Not every class needs to be injected”
After I read the MSDN article about structuring an MVC app in feature folders, I wanted to create my own Nuget package or dotnet template to easily achieve this.
Continue reading “Contributing to AddFeatureFolders package”
In the newer services at my client, AutoMapper is used to map DTO‘s to database objects and back. Because mocking a mapping isn’t obvious, a lot of behaviour wasn’t tested and that’s unacceptable. Let’s find out how to properly inject an
IMapper with actual mappings.
Continue reading “Injecting AutoMapper profiles in tests”
At work, I have a small gripe about a
Response class. It’s minor, but it keeps bugging me.
Continue reading “Constructor fun”
The software I’m working on needs a new authorisation system. The system needs to be prepared for 3 scenarios: to restrict access to a page, to hide part of a page and to block access to data. Let’s solve these problems using claims.
Continue reading “Use claims to authorise users to access specific data”
To create a report, I had to combine the contents of several PDFs into one. Thanks to iTextSharp, it’s really easy. Then I had the problem, how do I test this?
Continue reading “Comparing a PDF to a golden master”