Visual Studio Live Share for collaborative coding

Sharing code and working together on it in real time from different locations has been issue for years. We have video chat and screen sharing for long time but working on same files together in IDE has been a dream. Visual Studio Live Share is here to solve the problem. Although the service is not generally available yet it is possible to try out early versions of it using Visual Studio or Visual Studio Code.This blog post gives straightforward overview of Visual Studio Live Share specially for developers.

Read more

Reading request body in ASP.NET Core

Most of requests to controller actions of our ASP.NET Core applications send some simple parameters or some serialized model objects. But this is not always the case. There are also those requests we don’t want to map to models but we need the request body to process, save or use it some other ways. This blog post shows how to read request body in ASP.NET Core controller action.

Read more

New killer features planned for .NET Core, ASP.NET Core and Entity Framework Core 2.1

Microsoft announced roadmap for upcoming release of .NET Core family versioned as .NET Core 2.1. While there are some new features and many improvements coming I compiled a list of my favorites that I see as most imortant to all developers building solutions on .NET Core, ASP.NET Core and Entity Framework Core.

Read more

Entity Framework Core with .NET Core console application

ASP.NET Core makes it very easy to configure and use Entity Framework Core in web applications. For .NET Core console applications there is no such machinery available but we can still use Entity Framework Core in console applications. This post shows how to wrap database context initialization to separate class and use Entity Framework Core synchronous and asynchronous calls in .NET Core console application.

Read more

ASP.NET paging solution available at GitHub

Paging of data in ASP.NET and ASP.NET Core applications is timeless topic. It is invented over and over again and asked all the time in forums all over the world. Years ago I worked out kind of universal solution with reusable UI artifacts and I’m using these pieces this far. As ASP.NET Core is gaining more and more popularity I decided to start my sample solution with .NET Core and add full ,NET Framework and ASP.NET MVC 5 support later if asked.

Read more

NHibernate supports async

NHibernate, the O/R-mapper that some people consider as dead, is actually alive and very much alive. The release of version 5.0 at last autumn was somehow quiet and didn’t got much attention. But there is something that brings NHibernate to modern era – support for asynchronous database access. This blog post gives brief overview of new async methods in NHibernate and shares some ideas about how to start using them.

Read more

Refactoring: Improving the Design of Existing Code

Although I bought refactoring book by Martin Fowler years ago it is still valid. I call it one of the timeless books about coding and I consider it as a mandatory reading specially for novice programmers who are entering the field. Of course it is also useful handbook for those already in business. This refactoring book covers and organizes most of changes we are doing to source code every day and it greatly helps us to understand the nature of those changes at crafting level.

Read more

Performance of compiled queries in Entity Framework Core 2.0

Before applying any optimizations to our code we have to ask one question: what is the cost of improvement and is it really improvement? Compiled queries in Entity Framework 2.0 are categorized as high-availability feature but before making any decisions we need to know what is the actual win. This blog post introduces the measurements I made with simple database context to compare compiled and uncompiled queries in Entity Framework Core 2.0.

Read more

Writing IL code on Visual Studio

Microsoft Intermedia Language (MSIL) is .NET assembly language that is standardized under name Common Intermediate Language (CIL). All .NET compilers turn source code to this language. Although we hardly have a situation where we have to write intermedia language (IL) code directly it is still good to know how it works and how it is supported on Visual Studio. This blog post fills the gap and shows how to write IL code on Visual Studio.

Read more

Real-time talk between Windows 10 IoT Core background task and ASP.NET Core web application

My previous blog post introduced how to make ASP.NET Core 2 web application run on Windows 10 IoT Core. It was default web application created on Visual Studio and published as an executable. But this is not enough for IoT scenarios. When we build web application that runs on IoT board we need this application to do something. Be it displaying sensor data or controlling some hardware. This blog post shows how to make Windows 10 IoT background task talk with web application using WebSocket.

Read more

How to avoid overlapping timer calls?

Timers are useful .NET feature. With timers we can execute code with specified interval. With real scenarios we can easily face situations where timer calls its callback again but previous call is not finished yet. It may end up with loading some external system too much. It may also end up by making unexpected parallel data processing that distorts the results. This post introduces some options to avoid overlapping timer calls.

Read more