New feature of .NET Core 2 – Razor Pages

If you are looking for another way of building web applications then Razor Pages are for you! Razor Pages are page based programming model for ASP.NET Core MVC and they makes page focused scenarios easier and more productive. Razor pages are enabled by default in MVC and you don’t have to modify your Startup.cs code in any way. Assembly in which razor pages feature – – should b…

By Dawid on (tags: .NET Core 2.0, Pages, razor, categories: code)

Dependency injection everywhere

Just a few years ago there was just few people who known what dependency injection is. Today it is almost everywhere. Recently I’ve discovered that it can be also used in Razor views – thanks to ASP.NET 5. I will try to show you how we can use that feature on few examples bellow. Probably each of you have been populating drop downs in Razor views with data send from controller.…

By Dawid on (tags: ASP.NET, dependency, injection, IoC, next, razor, categories: code)

Converting Razor views into Pdf

This post talks about how you can convert Razor views into PDF. There is couple of NuGet packages which we can use to achieve that. I will try to describe couple of them. This library allows us to create documents in Portable Document Format (PDF). Some of the features: - generate documents and reports based on either provided HTML or by manually adding PDF elements such as tex…

By Dawid on (tags: convert, generate, pdf, razor, categories: tools, code)