Category Archives: How-to

[ASP.NET Core 1.0] Automatic Migrations in Entity Framework 7 (EF Core 1.0)

Advertisement from Google There is no more public Configuration() { AutomaticMigrationsEnabled = false; } in Entity Framework Core 1.0 (formerly  EF 7.0) Now you can use extension Migrate method during database initialization. Advertisement from Google For example, you have custom DBInitializer class: public class DBInitialization { public static void Initialize() { using (var context =… Read More »

[IoT] Connect Intel Galileo Gen 2 to Arduino Uno via nRF24L01

Guys from Newark element14 have sent me a nice dev board – Intel Galileo Gen2. I was curious because before, Microsoft declared that Windows 10 IoT Core will run on this board. I planned to run my previous benchmark on this board to see if it can beat Raspberry PI 2. Unfortunately, with the latest release they removed… Read More »

Build and test ASP.NET 5 application using AppVeyor

For those who do not know, AppVeyor is Continuous Integration and Deployment service for .NET projects. It is free for open-source projects. Currently, AppVeyor supports latest DNX version (1.0.0-rc1-final) and I’ve recently migrated my pet project to this version. I will show you how easy it is to build and run all unit tests on CI… Read More »

[ASP.NET 5] Lazy DBContext initialization with Entity Framework 7

I will show you how to do lazy db context initialization with Entity Framework 7. The idea is simple, we need an easy way to get database context in a request. If db context was used in the request we should call SaveChanges method and dispose used context if not we shouldn’t do anything. For “client”, code… Read More »

[WPF][MVVM] TreeView: Scroll To Selected Item

Here is the MVVM way to bring selected TreeViewItem into a view. First we need an attached behavior. We cannot use regular behavior because we will attach this property through Style. public class BringSelectedItemIntoViewBehavior { public static readonly DependencyProperty IsBringSelectedIntoViewProperty = DependencyProperty.RegisterAttached( "IsBringSelectedIntoView", typeof (bool), typeof (BringSelectedItemIntoViewBehavior), new PropertyMetadata(default(bool), PropertyChangedCallback)); public static void SetIsBringSelectedIntoView(DependencyObject element, bool… Read More »

[ASP.NET 5] Production Ready Web Server on Linux. Kestrel + Supervisord

In the previous article I’ve used nohup + su + init.d script to run kestrel in a background. But as Daniel Lo Nigro suggested in comments it’s much easier to do the same with Supervisor And he was absolutelly right, config is much smaller, and you can easelly see status and output of a program. First,… Read More »

[Windows 10] VIDEO_SCHEDULER_INTERNAL_ERROR after wake up

I have installed new Windows 10 on my PC, everything was fine until I decided to put my computer in to a sleep mode. After a while I turn on my computer and got my first BSOD. That was VIDEO_SCHEDULER_INTERNAL_ERROR. After this error, I have tried to update my chipset and video drivers, that didn’t work.… Read More »

“The system has returned from a low power state.” in the middle of the night

When I’m done working with my computer, I usually put it in a sleep mode. But recently (probably after some windows update), in the morning my computer was always on. Reason First I checked Event Viewer and found following record: The system has returned from a low power state. Sleep Time: ‎2015‎-‎07‎-‎29T20:54:24.378170500Z Wake Time: ‎2015‎-‎07‎-‎30T02:18:17.109989000Z… Read More »

[ASP.NET 5] Production Ready Web Server on Linux. Run Kestrel In The Background

In the previous article we have installed nginx as a “gate” for our ASP.NET 5 application. Today we will see how to start kestrel server in the background. We will do even more, we will create init.d script to control our APS.NET 5 application and start it on  the system’s startup. The simplest way to… Read More »