Tag Archives: C#

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

Advertisement from Google 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.… 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 »

ZohoPeopleTimeLogger v1.2 – Special for Andre

Because Andre is so special, the previous version of ZohoPeopleTimeLogger was not working with his account. I’ve fixed couple issues in the program to make him happy. Now, my friend, you can enjoy this lovely program! This release (v1.2) is dedicated to you! Download Now seriously! There was a small issue in a way I got information… Read More »

[C#] Zoho People Client Library

 Zoho People Client v1.0.0 released. ZohoPeopleClient – C# asynchronous client library to interact with the Zoho People API. Supported API TimeLogAPI (Get/Add/Delete) JobsAPI (Get) LeaveAPI (GetHolidays) FetchRecordAPI (Get) NuGet Package Source Code GitHub Current Release Build Status Examples Sign in with login and password var client = new ZohoClient(); var token = await client.LoginAsync(login, password);… Read More »

ZohoPeopleTimeLogger v1.1 Even Smarter Than Before

Yes! It finally happened. New version of ZohoPeopleTimeLogger released 🙂 Download In ZohoPeopleTimeLoger v1.1 you don’t need to think about your time tracking at all! This smart program will do everything for you. Do you have any booked vacation in this month? Not a problem. Press “Make me happy!” button and ZohoPeopleTimeLogger will fill all days… Read More »

ZohoPeopleTimeLogger v1.0.0 Keep Your Time Tracker Up-To-Date

Are you tired of filling in monthly time reports in Zoho People because of it’s stupid UI? Then ZohoPeopleTimeLogger is just a right solution for you. Only one button which will make you happy! One click and you are done!   How does it work? ZohoPeopleTimeLogger will automatically find Job that is relevant for the selected month and… 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 »

C# 6.0 await in catch/finally

C# 6.0 become more asynchronous-friendly than before. Finally, you can use await keyword in catch and finally blocks! Here is example: class Program { static void Main(string[] args) { do { Console.WriteLine("Before caller " + Thread.CurrentThread.ManagedThreadId); CallerMethod(); Console.WriteLine("After caller " + Thread.CurrentThread.ManagedThreadId); } while (Console.ReadKey().Key != ConsoleKey.Q); } public static async void CallerMethod() { try {… Read More »

[Raspberry Pi 2] Create C# Background Application for Windows 10 IoT Core

In this article,  we will see how to create simple Web Server for Raspberry Pi 2 running Windows 10 IoT Core. Because it is a Web Server we don’t need UI for this application, we can run it in headless mode. Open Visual Studio 2015 RC and create Windows IoT Core Background Application solution. Now… Read More »