LessThanDot Site Logo


A decade of helpful technical content

Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary.

Browsing "C#"

Mapping Complex types to/from JSON with JSON.Net

In an earlier post I introduced a strongly typed Identity object I am using in an ASP.Net Core application to make my code and error messages more readable. I didn’t wanted that extra complexity reflected in my database or over the wire with an API. In this post we’ll look at a simple method to […]


SPA Routing in ASP.Net Core

One of the challenges of SPA applications is making sure a bookmark or hard refresh knows how to load just enough of the content from the server before applying the client-side routing logic to that base page. This is not guaranteed to be the only way to do this, just the one that worked for […]


Mapping Complex Types to/from the DB with PetaPoco

Recently I was working on an application with rich C# objects that I wanted to store simplified in the database, without having to write custom logic for each new save or query that I add to the application. Luckily, the library I had chosen for data access (AsyncPoco, a variant Petapoco) has a mechanism that […]


Compiled list of C# + .Net Features

We have talked about doing this at work for a while, so I finally sat down this weekend and tried to make a list of C# features that the team could share. We intend to use this to help gauge who the best people are to ask questions in different areas (C# isn’t our only […]


Web API 2 – don’t get caught with your parameters down

Hi, A quick post for anyone else who has been literally dying from a lack of sleep trying to workout something that should be fairly simple. Quick background:  I got interested in Web API after I decided to build a friend a simple booking website driven by HTML5, jquery and originally an ASP.NET/c# .NET 4 […]


Threadsafe Incrementing in C#

Recently I’ve had the opportunity to review a number of different parallel C# methods that were performing work over a collection of items. Nearly all of them have used ++ to increment parent or global variables from inside threaded contexts. Unfortunately the ++ operator is not guaranteed to be threadsafe in C#. So let’s take […]


Testing the Not-So-Testable HttpWebResponse

Recently I was working on a library to consume a REST API without exposing any of the specifics to the rest of the application. Implementing a common interface and set of custom exceptions was easy enough, but exercising the internal logic was going to be tough.


Pick the Right Storage: All SQL is Not Equal

As part of a long series of posts, I implemented a version of the MVC Music Store tutorial application on top of a pair of SQL Server CE databases. SQL Server CE is great for small apps, being a portable file-based database that can easily be moved to a full SQL Server instance. Last week I migrated my application to use full SQL Server instances instead of the SDF file and picked up a 3x performance improvement. It was interesting enough that I decided to share 🙂


PetaPoco: Mapping related objects

In the prior PetaPoco post, I started to dig into many-to-one relationships a little. Chrissie followed up with yet more mapping behavior in his latest Simple.Data post, so I thought I would cover it in a bit more detail.


More PetaPoco: Id’s and Multi-POCO queries

So yesterday Chrissie and I did posts on Simple.Data and PetaPoco. Today he followed up with more complex examples, including keys and multiple table queries.

PetaPoco is built specifically with primary keys as a first class citizen, so it will be in…

Next Page »