Posts

Explicit loading in Entity Framework Core

Image
In this blog post, We are going to learn about Entity Framework feature. Explicit loading means that related data is explicitly loaded from the database at a later time. As you might know, that lazy loading is still not possible with Entity Framework core but there is a way to explicit load related data in a transparent manner.  We are going explore how we can load data explicitly with entity framework in this blog post in detail.

How to do Explicit loading in Entity Framework Core? To demonstrate how we can use explicit loading in Entity Framework core. We are going to create a console application with two entities Student and Department. A department can have multiple students. Here we are going to see how we can load students for each department explicitly.

So let’s create a console application like following.



Now once you click “Ok” it will create a console application. Now let’s add nuget package for entity framework core in console application like following. You need to run fo…

How to integrate HangFire with ASP.NET Core 1.1

Image
Hangfire is one of the easiest ways to perform background processing in.NET and.NET Core Applications. In this application we are going to learn how we are can integrate Hangfire with ASP.NET Core application.
About Hangfire: Hangfire allows you to create background task in.NET applications. It’s extremely easy to integrate. It allows you to kick off method calls outside of the request processing pipeline in very easy but reliable way. You can store those jobs in on premise SQL Server, SQL Azure, Redis, MSMQ or Redis.

You can find more information Hangfire on the following link.
http://hangfire.io/

Hangfire also contains one of very maintained documentation at the following link.
http://docs.hangfire.io/en/latest/
Integrating HangFire with ASP.NET Core 1.1: To demonstrate how we can integrate with ASP.NET core, I’m going to create a new ASP.NET Core application in Visual Studio 2017 like below.



Once click on it will ask for the selection of Application task we are going to select Web A…

New Features–Out Variables in C# 7.0

Image
Prior to C# 7.0,  For out keyword, we need to define that variable earlier and then we were able to pass that variable as out reference arguments. But now with C# 7.0, You don’t need to declare the variable but you can use the variable which you have used in arguments.

Following is a code showing both ways passing out variables.

In the above code, You can see that I have created get employee static method which put some values in this out variables. First I have shown the old way of doing this. Where I explicitly defined the variables and then passed it to function while in the new way of doing you don’t need to explicitly define variable. You can write this as an argument and then, later on, you can use the same variable in next statements.  Now when you run the application, the new and old way both produce the same output.




You can find complete source code of this examples at following location on Github at- https://github.com/dotnetjalps/CSharp7NewFeatures

Code Navigation features in Visual Studio 2017

Image
This blog post is a part of Visual Studio 2017 New feature Series TL;DR: With Visual Studio 2017 there are lots of new Code Navigation features introduced. We are going to look all the options available in Visual Studio 2017.

Navigation your code with Visual studio 2017: Visual Studio 2017 have newly refreshed code navigation features which help you moving from point A to B easily and fewer distractions. There are mainly four new features available.

Go to Implementation(Ctrl+F12): It helps you navigate from any base type to implementation of the concrete type.



Go To Line(Ctrl+G): It helps moves cursor from current line to specified line number.



Go To All(Ctrl+T): It helps you navigate directly to any file/type/symbol/member. You can move from any files to anywhere with this feature easily.



Go To File(Ctrl+ 1, Ctrl + F): You can easily navigate between files with this feature.



Go To Type(Ctrl+1, Ctrl + F): You can move to any type with this feature. It searches classes/interfaces/enum…

A new start page for Visual Studio 2017

Image
This blog post is a part of Visual Studio 2017 New feature Series Recently Microsoft has released a new version of Visual Studio 2017 and as usual, there are tons of features available with Visual Studio 2017. Visual Studio has always been one of my favorite IDE. We are going to look into all the features one by one. The first thing when you launch a New instance of the Visual studio will launch a start page. So in this blog post, we are going to explore what’s new in start page of Visual Studio 2017.

A new start page for visual studio 2017 The first thing once you load visual studio 2017 will have a start page. It has been divided into three columns. The first column contains Get Started and Recent sections. The second column contains Open Project and New Project section and the third column contains Developer new section. By default when you load Visual Studio it looks like following.



Get Started and Recent Section of Start Page: Get Started section of Visual Studio 2017 contains h…

New Blog theme- new technologies

Image
This blog has been quite for the some time. I was busy doing some professional commitments but now I decided to write blog post regularly. As there are lots of interesting stuff happening in technology world. There are tons of new technologies coming up and lots of new things to learn.

New blogger theme: Recently blogger.com has launched few new theme and I also decided to have new blogger theme on my blog. I have used “Contempo” theme for my blog. This time I have done some experiments I have not changed anything except the background feature. Let’s see how it goes with SEO and other stuff.  Here is new look of my blog.



Hope you will like it.

New Technologies to blog : There are lots of stuff happening in technology and I started learning those technologies and I’m going to share my learning experience with you guys for sure. So do except blog post on following topics.
Visual Studio 2017ASP.NET Core 1.1C# 7.0Entity Framework Core.NET Core cross platformDockerNode.jsGolang SQL Server…