When developing an application that connects to a SQL Server (or Azure SQL) database, you will often want to leverage the features that the database engine provides to help minimise checks that would otherwise need to be performed at the application level. By delegating these checks to the database, you can simplify your application logic,…
Tag: .NET
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…
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…
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…
InSecurity
Many options are available when it comes to encrypting sensitive data via a .NET application. However, while the System.Security.Cryptography namespace provides a plethora of different encryption algorithms, many of these are obsolete and should be avoided if possible. It is therefore important to keep abreast of the latest recommendations, especially when it comes to security-critical…
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…
It isn’t usually possible to launch a GUI (Graphical User Interface) application from a Windows Service. There are good reasons for this; aside from the security considerations, being interrupted while doing something important by a badly behaving background application would not be fun! However, there are some limited use cases for starting processes that feature…
IdentityModel is an open-source library developed by Dominick Baier and Brock Allen which does an excellent job of simplifying interactions with OAuth 2.0 and OpenID Connect servers. However, when it comes to unit testing, it can appear on the surface to be somewhat difficult to create certain objects that need to be instantiated on demand…
Every process on a Windows device features a ‘command line’ that may include one or more arguments or ‘switches’ that can affect the behaviour of the running program. While it is possible in a .NET application to specify the arguments to use before starting a new process, currently there isn’t an API that allows the…
Azure Functions is an Azure cloud service that allows software developers to focus on writing code that reacts to events, without needing to concern themselves as much with the infrastructure that the code is running on. Azure Functions applications are serverless by nature and can scale to meet demand with minimal overhead and cost. There…