C# – How to use enum flags to pass multiple options as a single parameter

When you need to pass multiple options into a method, normally you would add a bool flag for each parameter, like: Not only is using bool flags a bit of a code smell, but when this list of parameters gets too big, you’ll probably want to refactor by moving the bool flags into an options … Read more C# – How to use enum flags to pass multiple options as a single parameter

JsonException: The JSON value could not be converted to Enum

When you’re using System.Text.Json to deserialize JSON that contains the string representation of an enum, you get the following exception: System.Text.Json.JsonException: The JSON value could not be converted to <Enum Type> The following JSON would cause this exception. Conference is an enum, and this is using the string representation “NFC” instead of the numeric value … Read more JsonException: The JSON value could not be converted to Enum

ReportViewer RDLC – How to show an enum’s string representation

Problem I’m building a report using ReportViewer. I’m setting the Data Source to a collection of model objects. One of the fields on the model is an enum. When the report renders, it is showing the enum’s numeric value. I want it to show the string representation of the enum instead. Solution In the field … Read more ReportViewer RDLC – How to show an enum’s string representation