[NoBrainer] Running ad-hoc benchmarks with BenchmarkDotNet and C# Scripting (CSI)

Creating benchmarks with BenchmarkDotNet is very easy and running them is even easier with the Visual C# Interactive Compiler (CSI for short). If you need more information about CSI, read Essential .NET – C# Scripting to get started). And here is how it works: Select the Developer Command Prompt for VS2015 from the Start Menu […]

[NoBrainer] C# and IEnumerable.ForEach

By default we cannot use ForEach() on IEnumerable but only on List. However, with extension methods to the rescue, it is easy to roll your own: Regarding the implementation I saw a few options: I could implement ForEach() with a traditional for loop, parallelise the operation, use ToList() to convert the list or other LINQ […]

Using Dependency Injection with StructureMap to decouple business logic from WebApi OData Controllers

Today’s post title is rather lengthly so I keep the introduction short and come right to the point: when using OData (or any web services therefore) it can become quite hard to keep the actual business logic separate and not to mix things where they do not belong. At least for me, as I have […]

[HOWTO] Create LocalDB File (.mdf) manually in Visual Studio 2015

If you are using LocalDB and want to create an empty database you should perform the following steps. Go to Visual Studio Server Explorer | Data Connections Select Add Connection from the context menu Change Data Source to Microsoft SQL Server Database File (i.e. LocalDB) Set the Database file name by entering a database name […]