Modern Logging with SeriLog and Seq – part 2. Entry Point Logging

Entry Point Logging allows you to track all your API calls and the calls they make from a single place In the first part of this series I gave a brief overview of Serilog and Seq and what differentiates them from logging you may have done in the past.  One of the most useful aspects of structured logging is the...

Continue reading →

Modern Logging with SeriLog and Seq

Add structure to your log entries and bring your logs up to date It used to be that logging was a bit of an after thought where a few statements such as 'Connecting to the database' or 'Invalid user login' were written to a text file that was rarely looked at.  Well things have moved on a fair bit since then. Part 1...

Continue reading →

Enhancing Claims with Owin Middleware & Claims Transformation

Standardise your basic user data and add it to your ClaimsPrincipal for easy access! Recently I was working on a web api 2.0 project that used a bearer token for authentication and passed a UserId in the claims for the generated ClaimsPrincipal. Each controller in the project was accessing the User property from the ApiController base class to get the UserId...

Continue reading →

Going Further with Fluent Builders in your Tests – C#

Fluent Builders are extremely useful. Once you start using them there is no going back! In my first article I outlined fluent builders - what they look like and how to put them together. This time I will go a little deeper to show you just how versatile they can be. Method Naming You can be as flexible as you like in...

Continue reading →

Power BI – Quick Tip. Percent of Total

If you need to add 'Percent of Total' to your charts in Power BI, here's how.. Microsoft's Power BI is excellent.  It is so easy to get up and running with data coming from a multitude of places. Out of the box you can easily show facts and figures related to your data.  One thing it currently misses though is...

Continue reading →

Use Fluent Builders In Your Tests – C#

When creating tests (for TDD or BDD), use fluent builders No, I don't mean the kind that come around and drink all your coffee / tea. When you are testing your code you often have to initialise various classes beforehand. There are several ways to do this. Consider this simple api that takes in a 'Booking' object and returns the...

Continue reading →

5 Lesser Known Reasons To Upgrade To Visual Studio 2015

Searching the web there are plenty of articles about Visual Studio 2015 and all that it brings with it, but you may have to dig down to get to some of the new features that will be instantly of help in your everyday activities.  Here are the five lesser known ones that most interest me... Debugging Lambda expressions This has been...

Continue reading →

More concise, more readable. C# 6.0 real world gains

With Visual Studio 2015 comes C# 6.0. The team at Microsoft put a whole lot of effort into the Roslyn compiler this time around and the language features are primarily syntactic sugar, but they are still extremely welcome. The Null-Conditional Operator Here is a small piece of code that I inherited recently.  It has a very simple task, get the client's...

Continue reading →

How to export a lot of data from on-prem SQL Server to Azure SQL for testing

Lately we have created several data marts in Azure SQL that will be fed from a data warehouse hosted on premises. The data mart is first created and tested locally so that we can get the structure and required stored procs correct. Whilst we are doing this it is easy to quickly transfer representative data to test the efficiency. Every...

Continue reading →

Adding tables of static data to an SSDT project

Quite often when creating a database you will need tables of static data.  These range from simple lookups to date dimensions in a data warehouse.  You can easily create these in an SSDT project.Presuming you have already designed your tables and they are present in your project;Create a folder in your project called StaticData then add a sql script...

Continue reading →

Adding database references to a sql server project

If you are creating a sql server project with SSDT (see here) and your sql refers to another database you will need to add a database reference to allow the project to build. You can do this by right clicking your references folder and selecting 'Add Database Reference' If the database you are referring to is also a part of the...

Continue reading →

Visual Studio SSDT and TeamCity – Using Publishing Profiles and TeamCity integration

Database DevOps - SSDT and TeamCityUsing Visual Studio and SSDT you can immediately publish a fresh database or update an existing one by simply right clicking the database project and choosing 'Publish'. This will bring up a dialog that lets you edit the connection string to your database and set various options related to the publish.At this point you have a choice...

Continue reading →