Teemablogi sissekanded

10.07.2017

ASP. NET Core 2: New single page application templates.

With ASP. NET Core 2. 0 Preview 2 there are new web application templates available for Single Page Applications (SPA). Currently Angular, React. js and React. js + Redux are supported. This blog post gives short overview of new templates and related sample application. New SPA templates When creating new ASP. 09:14 10.07.2017 kanalilt DT blogi 2

06.07.2017

Local functions in C# 7.0

One of new features of C# 7. 0 is support for local functions. Local functions are methods that are defined inside other methods to simplify more complex code and by example to support local recursion. This blog post shows how to use local functions in C# 7. 0 and gives some advice in context of technical design of code. To illustrate local function I will use finding of factorial as an example. 08:19 06.07.2017 kanalilt DT blogi 2

26.06.2017

Simple solution for metrics targets on MSSQL

I needed flexible solution to keep measurements with target values in SQL Server database. After some playing with tables and functions I came out with simple, clean and flexible solution that fits also well for many other scenarios besides the one I had to support. This blog post summarizes my work and provides all SQL stuff needed to reproduce it. 09:25 26.06.2017 kanalilt DT blogi 2

05.06.2017

Building web API apps on ASP.NET Core 2 and VB.NET

ASP. NET Core 2 will come with full support for VB. NET. In current preview we can use VB. NET to build . NET Core applications. I was still successful on mixing up C# and VB. NET project files and port C# code over to VB. NET and build proof-of-concept level web API applicaton that returns fake data about current weather in different cities. NB! VB. NET support in ASP. 09:43 05.06.2017 kanalilt DT blogi 2

01.06.2017

Simple .NET Core application using VB.NET

NET Core 2 Preview 1 bits bring us support for VB. NET on . NET Core. Although tooling for web applications is not ready yet we can start with console applications and also some web applications like I will show in some of my later posts. Visual Studio 2017 Preview 2 is needed to try VB. NET out on . NET Core. This blog post is short demo about how to build simple utility application on . NET Core 2 Preview 1 using VB. NET. 08:21 01.06.2017 kanalilt DT blogi 2

30.05.2017

MSSQL: Finding weekend days in month

One of my applications displays tables with some calculations about users working time. This is for corporate reporting. For this table I needed a way to find how many weekends days are in given month. As most of calculation work is done in SQL Server stored procedure I decided to keep stuff there and found a way how to get weekend days with common table expression. 09:02 30.05.2017 kanalilt DT blogi 2

24.05.2017

Creating simple shoutbox using ASP. NET Core Razor Pages.

ASP. NET Core 2 comes with Razor Pages that allow developers to build simple web applications with less overhead compared to MVC. The emphazise is on the word “simple” as Razor Pages doesn’t come with patterns suitable for bigger and more complex applications. For this we have MVC that is flexible enough to build applications that will grow over years. 10:55 24.05.2017 kanalilt DT blogi 2

19.05.2017

Razor Pages with ASP.NET Core 2

With ASP. NET Core 2 we get another way of building web applications. It’s one of those new things that is actually forgotten old thing and it is called Razor Pages. Are we going back to WebMatrix days? This blog post is short introduction to Razor Pages in ASP. NET Core 2. One of new features of ASP. NET Core 2. 0 is support for Razor Pages. Yes, those same pages that came times ago with WebMatrix. 09:15 19.05.2017 kanalilt DT blogi 2

02.05.2017

What is Micro ORM?

Micro ORM-s are useful small ORM-s that are lightweight and map between objects and database queries. This blog post discusses when to use Micro ORM-s and provides example code where Micro ORM called Dapper is used. ORM and Micro ORM ORM is Object-Relational Mapper and it works as querying and object creation runtime between client code and relational database. 08:20 02.05.2017 kanalilt DT blogi 2

27.04.2017

General CSS path transform for ASP.NET bundling

In couple of ASP. NET projects I have had a CSS path transform problems with bundling and minification. CSS-files are coming in from external agencies and from different open-source projects and the number of files is so big that it is problematic to go through all of these after updates. I found solution path transform solution that works for me in most cases and it is described here. 08:20 27.04.2017 kanalilt DT blogi 2

25.04.2017

Taking meeting notes with Lumia 950

In the beginning of year I bought Lumia 950 and got Continuum with it for free. Lumia 950 is excellent phone and I started experimenting with it. One of my first experiments was to make it companion device for meetings so I don’t have to drag my work laptop with me. Developers usually work on powerful laptops and often these machines are annoying to carry around. Bluetooth devices can be connected to Lumia 950 without using Continuum. 09:20 25.04.2017 kanalilt DT blogi 2

24.04.2017

Detecting faces on photos using Microsoft Cognitive Services

I started playing with Microsoft Cognitive Services and discovered that it makes many otherwise complex tasks very easy. This blog post shows how to build web application that detects faces on uploaded photo. Cognitive services account. You need Microsoft Cognitive Services account before you can use services. Only thing you need is Microsoft Account or Office 365 account. 09:17 24.04.2017 kanalilt DT blogi 2

20.04.2017

Introduction to Microsoft To-Do

Microsoft launched yesterday a new cloud service called Microsoft To-Do. The aim of new service is to provide users with simple and familiar looking tool to plan a day. The new service comes with nice looking web interface and there are also apps available for most popular platforms, including Windows and Windows Phone. NB! Microsoft To-Do works currently only with Microsoft Account. 08:20 20.04.2017 kanalilt DT blogi 2

19.04.2017

Using Entity Framework Core in-memory database for unit testing

ASP. NET Core applications can be tested with different testing frameworks and Entity Framework Core makes testing specially easy by removing different technical problems from our way by using in-memory data provider. This blog posts shows how to unit test controllers that use data from Entity Framework Core. NB! The code and tests given here are really minimal and illustrative. 10:01 19.04.2017 kanalilt DT blogi 2

18.04.2017

Using memory cache in ASP.NET Core

ASP. NET Core has memory based caching similar to what we had in previous ASP. NET versions. This blog post shows how to use memory cache alone and with support for distributed cache in ASP. NET Core web applications. Using memory cache Using memory cache starts with adding caching support to services when application starts up. public void ConfigureServices(IServiceCollection services){ services. 11:12 18.04.2017 kanalilt DT blogi 2

17.04.2017

Triggering Azure Functions from Office 365 SharePoint using Microsoft Flow

We cannot use classic SharePoint workflows on Office 365 but using Microsoft Flow we can create new era flow applications that are triggered by events that happen in different sources. This blog post shows how to use Microsoft Flow and Azure Functions to send out e-mail when new meeting is added to SharePoint list. The idea of this blog post is to illustrate how to create the flow where custom code takes over in some point. 09:20 17.04.2017 kanalilt DT blogi 2

07.04.2017

ASP.NET Core: SQL Server based distributed cache

ASP. NET Core supports also distributed cache solutions. Out-of-box there is support for SQL Server and Redis based distributed caches. This blog post focuses to SQL Server based cache we can use when there are really no better options. We don’t need distributed cache with solutions running on one box. 09:30 07.04.2017 kanalilt DT blogi 2

05.04.2017

C# 7.0: Throw expressions

C# 7. 0 introduces throw expressions. We can add exception throwing to expression-bodied members, null-coalescing expressions and conditional expressions. This blog post introduces throw expressions, demonstrates how to use them and also provides a peek behind a compiled throw expressions. Throw expressions are the way to tell compiler to throw exception under specific conditions like in expression bodied members or inline comparisons. 09:20 05.04.2017 kanalilt DT blogi 2

04.04.2017

C# 7.0: Tuple literals

C# 7. 0 brings some new features to tuples and with code editors that support these new features we can use tuples with named members instead of names like Item1…ItemN. This blog post goes through practical example that demonstrates how to move on classic method that returns multiple values to new tuples. I take example from practice and modify it a little bit. 09:20 04.04.2017 kanalilt DT blogi 2

03.04.2017

HTTP-triggered Azure Functions

Azure Functions supports functions that are invoked by HTTP request. It makes it easy to have some scripted functionalities on cloud that we can invoke by simple HTTP request. This blog post shows how to build and run HTTP-triggered Azure Functions using Visual Studio. 09:20 03.04.2017 kanalilt DT blogi 2