Injecting resource files as plain JavaScript objects in ASP.NET Core

Localization and internationalization are much-discussed topics and many terrific solutions have been developed to easily create multilingual applications. I would like to introduce a different way of localizing web-based applications. As the title suggests, I will show you how to inject resource files as plain JavaScript objects to the web client. The result is a simple JavaScript object which is globally available to the client. I found this so useful that I did a similar thing for translated content and even the application’s settings (which are stored in a database).

How to automatically load navigation properties in Entity Framework (Core)

Anyone who has worked with Entity Framework will have had to manage with loading related entities. I believe many developers will agree the way that system works is difficult to reconcile with design patterns such as the Repository pattern. In this post, I’ll provide one quick and easy way to automatically load all related properties from the database.

Update 2018-11-26: Added the equivalent for EF Core.

Digital nomadism (in the Americas)

Between September 2016 and February 2018, I traveled through the Americas as a digital nomad. I usually try to avoid using this term because one may get the wrong idea of what it means when watching certain YouTube videos or Instagram pictures. Or just simply google it. Chilling out in a hammock on the beach on a sunny day with your laptop on your lap drinking your $10 margarita while getting a foot massage really doesn’t work and does not represent the lifestyle.

How to fix SQL Server Data Tools error ‘Unexpected exception caught during population of source model’ in Visual Studio 2017

For the last few days I’ve been getting an error when comparing database schemas in Visual Studio using the SQL Server Data Tools:

“Unexpected exception caught during population of source model: Object reference not set to an instance of an object”

Simplify and automate text manipulation with NimbleText

NimbleText is a useful tool that has been in my toolset for many years now. On the website, NimbleText is described as a “text manipulation and code generation tool (…) that magnifies your ability to perform incredible feats of text and data wrangling”. I agree with this statement and I don’t think it’s an exaggeration. And best of all, it’s free! There is a premium edition which unlocks all features and costs around $20. There is also a fiddle-like version available.

Creating and publishing NuGet packages to VSTS feeds in Visual Studio

In this post I will show you a number of ways in which you can create and publish NuGet packages to your own feeds. But the focus will be on a new Visual Studio extension that I have written during my assignment for Dime, who were gracious enough to share this utility with the rest of the world.

Exam 70-487 Preparation: the review

Over the last few weeks, I made a few blog posts containing useful links for Microsoft’s certification exam 70-487: Developing Microsoft Azure and Web Services. I’m pleased to announce that I passed the exam with a score of 873. And because this is the third exam in the MCSD Web Applications track, I am now also a certified Microsoft Certified Solutions Developer.

Preparation materials for Exam 70-487: Developing Microsoft Azure and Web Services

Months behind schedule, I have begun preparations for my next exam: 70-487 Developing Microsoft Azure and Web Services. If I pass this one, I’ll be MCSD in Web Applications.

A repository of useful PowerShell scripts

I have had to generate a lot of new files lately, and because I am allergic to repetitive work, I looked for a way to dynamically generate and process files. And for my case, PowerShell scripting comes pretty close to what I needed. Just like a few of my other posts (the best of StackOverflow and Things I always have to Google, I decided it would be a good idea to centralize these scripts and share them with you. Most of these scripts were made for one specific case so they’re not generic – but upon request I’ll try to make these as generic as possible. This is going to be a post that I’ll hope to update on regular occasions, so make sure to pay a visit every now and then if you’re working with PowerShell too.

ASP.NET MVC and HTML5 Web Workers

Although the technology has been around for a while now, HTML5 Web Workers didn’t draw my attention until a few days ago. As I’m building a client facing SaaS application for my client, performance is crucial. Having worked with asynchronous methods in C# for years, I thought of using this concept in JavaScript. As it turns out, multithreading in Javascript isn’t really part of the package. You had to work with timeouts and callbacks to implement some kind of asynchronous architecture, but splitting some heavy work into multiple threads (and even background work for that matter) wasn’t really supported out of the box – until HTML5 Web Workers were introduced. In this article, I’ll explore the capabilities in two different ways in the context of a ASP.NET MVC 5 application. What I’m not going to cover is the theoretical aspects of web workers.

Best of Stack Overflow

Just as in my other post about topics I have to “re-Google” often, this post serves as a catalog of interesting Stack Overflow articles. Because the concept of browser favorites doesn’t work quite well in my world, this blog post does the job of keeping a simple and convenient list very well. To keep things as simple as possible, I have divided the post in categories, comparable to the tags in Stack Overflow.

ExtJS grid page size – letting the user decide

In addition to this article, I have embedded this feature into a new PagingToolbar child class. Basically it adds a combo box to the toolbar’s items and then adds extra behavior so the store reloads with the specified page size.

 

It can be made even more generic and probably cleaner but this is an acceptable solution to the problem. Comments or suggestions are always welcome!

 

 

Create lambda expressions on the fly in C#

For the last couple of weeks I have been working with client-side frameworks such as Kendo UI and Sencha ExtJS a lot. One of the requirements of my clients was server-side filtering, grouping and ordering of several grids and other components. The challenge here is that you don’t know exactly what information might be coming in: which field do you have to filter or sort, which direction, what operator do you have to use, etc. There is only one proper way to do this in C#: Expressions.

New features in C# 6.0

With the release of Visual Studio 2015 last week, I thought it would be a good time to inspect the new features that come with the newest version of C#. Although C# 6.0 is certainly not a major release from a developer’s perspective, there are some items that every developer will use in the coming years. In this post, I’ll show some examples on how to use these new features.

ASP.NET MVC fixing error ‘Multiple types were found that match the controller named’ when routing is not the problem

I just came across following error message while I was converting one of my ASP.NET MVC applications:

Multiple types were found that match the controller named 'Home'. 

How to prepare for Microsoft exam 70-483 programming in C#

Today I passed the 70-483 Programming in C# exam. As any other Microsoft exam, the passing score is 700 on a total score of 1000. I scored way above my expectations, so I’m very happy that my efforts are rewarded with a MCP certificate. I can highly recommended experienced consultants and developers to take this exam. For beginning programmers ( < 1 year) this exam will probably be too difficult as there are many topics in scope of the exam. In order to motivate anyone who wants to take this exam, here is how I experienced the exam.

Managing shared information with IDisposable in C# and SharePoint

Every once in a while you’ll have a situation in which you temporarily have to use different (shared) settings and reset them if all work is done. An example of this is often seen in SharePoint, for instance disabling events when updating items in event receivers, or allowing unsafe updates. A workaround that I have seen a lot is that developers add a TRY/CATCH/FINAL block for each method they want to reset some objects. In this post, I’ll talk about an alternative way of achieving this behavior by the implementation if the IDisposable interface.