All Posts tagged as "C#"

Exploring Object Layouts

Removing fields from an object should reduce that object's size. Why am I not seeing any difference?

Read

Using TaskCompletionSource to change the semantics of async calls

We need to asynchronously call external processes and proceed when we have a result. How do we do that without requiring a re-architecture of our entire iterative system?

Read

Here be dragons: string concatenation

String concatenation can be done in several ways, each with their own advantages and usecases. In this blogpost I will take a closer look at 4 different ways of concatenating strings and how these are implemented internally. At the end of this post I hope I will have made clear when they are useful, when they are not and how they compare to eachother implementation-wise.

Read

Quick Tip: Getting a variable's data during debugging

Ever wanted a quick overview of an element in debug mode?

Read

Introducing: VSDiagnostics

I am happy to announce the first release of VSDiagnostics! This project is a group of diagnostics meant for Visual Studio 2015 and up which will help the developer adhere to best practices and avoid common pitfalls.

Read

VSDiagnostics

A collection of static analyzers based on Roslyn that integrate with VS

Read

Introducing: RoslynTester

NuGet package to help you unit test your Roslyn-based analyzers

Read

RoslynTester

NuGet package to help you unit test your Roslyn-based analyzers

Read

Getting started with your first diagnostic

With the release of Visual Studio 2015 RC, we also received the pretty much final implementation of the Diagnostics implementation. This SDK allows us to create our own diagnostics to help us write proper code that’s being verified against those rules in real-time: you don’t have to perform the verification at a separate build-step. What’s more is that we can combine that with a code fix: a shortcut integrated in Visual Studio that provides us a solution to what we determine to be a problem.

Read

Hello Linux!

Like many other .NET developers I have been following the Build conference that’s going on right now. One of its biggest announcements (so far) was the release of Visual Studio Code and the accompanying CoreCLR for Linux and Mac. It sounds nice and all but I wanted to try this out myself. I have decided to get a Console Application working in Ubuntu 14.04 since we’ve all seen by now how to deploy an ASP.NET web application.

Read

How to configure a custom IdentityUser for Entity-Framework

I am getting accustomed to the ASP.NET Identity framework and let me just say that I love it. No more boring hassle with user accounts: all the traditional stuff is already there. However often you’ll find yourself wanting to expand on the default IdentityUser class and add your own fields to it. This was my use case as well here and since I couldn’t find any clear instructions on how this is done exactly, I decided to dive into it especially for you! Well, maybe a little bit for me as well.

Read

How to unit test your OWIN-configured OAuth2 implementation

Unit testing your OAuth2 API

Read

Unit testing Web API routes and parameter validation

Let’s talk about routing. If you’ve ever developed a web application then you know the hassle you have with the constant “Resource not found” or “Multiple actions match the request” errors. What if I told you you could fix all this without ever having to open a browser? That’s right: we’ll unit test our routes! As an added bonus I’ll also show how you can unit test parameter validation since that’s probably one of the most important things to do when creating a (public) API.

Read

Properly testing Entity-Framework with Effort

An introduction to testing your EF logic

Read