Quantcast
Channel: Software Development – The Blog of Colin Mackay
Browsing index pages (34 articles)
↧

Image may be NSFW.
Clik here to view.

Speed up Visual Studio by turning off the Source Control Plug-in

I don’t use the built in source control plug in Visual Studio as I use GitKraken instead, so Visual Studio’s plug-in just sat in the background not doing much as far as I could see. Then...

View Article


Image may be NSFW.
Clik here to view.

Why is my app not responding? Oh… I’ve hit a breakpoint!

Have you ever run your app from Visual Studio to have it suddenly stop responding and you can’t immediately see why, only to discover that you’ve hit a breakpoint and didn’t realise because Visual...

View Article


Why is there a difference between decimal 0 and 0.0?

const decimal ZeroA = 0M; const decimal ZeroB = 0.0M; They’re the same thing, right? Well, almost. The equality operator says they’re the same thing. bool areSame = ZeroA == ZeroB; // is true But...

View Article

Image may be NSFW.
Clik here to view.

ReSharper test runner still going after tests complete

I’ve been writing some tests and I got this message: [RIDER LOGO] Unit Test RunnerThe process ReSharperTestRunner64:26252 has finished running tests assigned to it, but is still running.Possible...

View Article

How to: Tell if a PowerShell script is running as the Administrator

$currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent()) if (-not...

View Article


Ensure Controller actions/classes have authorisation

A couple of years ago I wrote a unit test to ensure that all our controller actions (or Controller classes) had appropriate authorisation set up. This ensures we don’t go to production with a new...

View Article

Creating a Throttle with an ActionBlock – Addendum (Cancelling)

In my previous post I described how to create a throttle with an action block so you wouldn’t have too many tasks running simultaneously. But what if you want to cancel the tasks? In our use case, we...

View Article

Creating a Throttle with ActionBlock

We have an application that needs to perform a repetitive task on many external services and record then aggregate the results. As the system has grown the number of external systems has increased...

View Article


Comparing logically adjacent rows in a database table

If you have database table that stores something such as when an action occurred, it might be useful to work out how far apart these events are. It is easy to join different tables together, or even if...

View Article


Image may be NSFW.
Clik here to view.

Paramore Brighter: The Russian Doll Model

I’ve mentioned a bit about the attributing the handler and the step and timing parameters, but I’ve not explained them properly in previous posts (“Retrying commands” mentions steps, and “Don’t Repeat...

View Article

Paramore Brighter: DRY with Custom Decorated Command Handlers

You may wish to add similar functionality to many (or all) command handlers. The typical example is logging. You can decorate a command handler in a similar way to the policies I showed in previous...

View Article

Paramore Brighter with Quality of Service: Retrying Commands

Paramore Brighter supports Policies to maintain quality of service. This is useful when your command makes calls to external services, whether they are databases, web services, or any other end point...

View Article

Paramore Brighter: Implementing a fallback exception handler

So far in this series, we have a basic command processor set up and able to dispose of resources. But what happens when things go wrong? The command processor has a fallback mechanism to handle...

View Article


Paramore Brighter: Ensuring Dependencies are Disposed.

In my previous post, I showed how to set up Paramore Brighter with the built in Dependency Injection provided with .NET Core 2. However, it wasn’t the full story. The code for this post is on GitHub....

View Article

Paramore Brighter: Using .NET Core’s Dependency Injection

This is the first in a series of posts on Paramore.Brighter. I’m writing this as a series of recipes, with the aim of you picking up a point quickly and getting going with it. The code for this post is...

View Article


Image may be NSFW.
Clik here to view.

Join Null Check with Assignment

I recently wrote some code and asked ReSharper to add a null check for me, which it did. Then it suggested that I could simplify the null check by joining it to the assignment. Intrigued, I let it....

View Article

Image may be NSFW.
Clik here to view.

Aggregate of columns, not rows

In SQL Server it is very easy to aggregate a value across many rows. You simply just write something like this: SELECT MAX(SomeColumn) FROM SomeTable This will return one row with the aggregate value...

View Article


Image may be NSFW.
Clik here to view.

But why is the iterator operating in multiple-threads

Background Recently, I had a bit of a problem with NHibernate when I was converting some code into parallel tasks. (If you have no interest in NHibernate, then don’t worry – it is just background to...

View Article

Image may be NSFW.
Clik here to view.

Overusing the Null-Conditional Operator

The null-conditional operator is the the ?. between object and field/property/method. It simply says that if the thing on the left hand side is null then the thing on the right hand side is not...

View Article

Image may be NSFW.
Clik here to view.

Application Configuration in .NET Core – Part 2

In the first part we got started by pulling in configuration data from multiple source in .NET Core, in this part we’ll look at mapping the configuration onto a set of classes so that is becomes easier...

View Article
Browsing index pages (34 articles)


Latest Images