In the increasingly fast-paced world of software development, efficiency is a critical factor for success in the marketplace. Visual Studio, Microsoft’s flagship IDE (Integrated Development Environment), is packed full of features designed to make your programming experience as productive as possible. Among these is a lesser-known feature that is extremely useful; the ability to paste…
Category: Programming
By default, Entity Framework Core stores and retrieves .NET enumerations as their underlying integer values for SQL databases, primarily for performance and storage optimization reasons. Nevertheless, if there is a requirement to store enums within your data model as strings at the database level, it is important to have a suitable way to configure this…
CSV (Comma-separated values) remains an extremely popular file format, and, in the context of programming, it is particularly useful for importing and exporting data between different software applications. One of the issues with CSV, or any other delimiter-separated file format, is that often the values that need to be parsed into separate ‘parts’ will contain…
C# enumeration types (enums) provide a highly extensible and type-safe way of storing values and they are used frequently in .NET software development. When enums are saved to a SQL database with Entity Framework Core, by default they are stored using their underlying integer values rather than as strings. There are several reasons for this…
The majority of software applications developed today need to work with strings that contain accented characters such as à and é since many human languages use these to indicate variations in pronunciation and other subtleties. Even English borrows some French words that contain accents and other glyphs, such as café, déjà vu, and façade. These…
In light of the recent controversy surrounding the .NET Moq library, many developers are reconsidering their choice of mocking framework for unit testing. The undisclosed inclusion of the proprietary SponsorLink DLL that reportedly extracts internal developer email addresses and uploads them to a remote server has undoubtedly been alarming to many. Beyond the immediate privacy…
The term Nullable Reference Types refers to a set of features introduced in C# 8.0 that help us to write cleaner, more robust code that is resistant to unintended null dereferencing. The features that are provided make us aware of possible null reference exceptions that could occur in our applications, reducing the likelihood of encountering…
Local AppData is a directory within the Windows operating system where software applications can store data that is specific to the current user. Getting the location of the Local AppData directory for the current user within a .NET application is straightforward. However, currently, there isn’t a .NET API that allows you to get the Local…
When types from another assembly cannot be referenced statically at compile-time in a .NET application, subscribing to events defined in that assembly and subsequently accessing event arguments that are passed to event handlers can seem a little tricky. Thankfully, with the combination of the Reflection API and the dynamic operator, it is possible to subscribe…