Get started with ABP framework on a Mac

In this post we’ll explore setting up the popular ABP framework for .NET Core on a Mac with a Postgres database. In case you’re unaware, the ABP framework offers a number of out of the box features that can save a tremendous amount of time when starting a new web application. This includes a strong and opinionated architecture based on domain driven design, as well as multi-tenancy, theming and more....

May 19, 2021 · 3 min

Understanding the Newtonsoft JSON Token

One of the concepts worth understanding when writing a custom converter for the popular Newtonsoft JSON framework is that of the JsonToken, and the role it plays in helping you understand the JSON being read. The JsonToken documentation for Newtonsoft is relatively sparse - in part because once you understand it, it’s a relatively simple concept. Effectively, when you’re attempting to deserialise a string representation of a JSON object, such as in the ReadJson method of a custom JsonConverter, the JsonToken represents each element or component (token if you prefer) of the object as it’s deserialised....

March 26, 2019 · 2 min

Throw or throw ex in C#?

One common question that comes up when working with exceptions in C#, is whether or not you should re-throw an existing exception by specifying the exception, or just using the throw keyword where an error occurs. In most cases, it’s best to rethrow the existing exception, such as below: 1 try { var networkResponse = await someNetworkService.GetAllPosts();}catch (Exception ex){ Log.Warning("An exception occurred", ex); //Now lets rethrow this same exception throw;} By doing so, you ensure that the original stack trace for the exception is maintained....

March 20, 2019 · 1 min