Blog

Blog posts on .NET, Azure, and more.

Using Response Compression Middleware in ASP.NET Core

October 26, 2016 by Anuraj

C# ASP.NET Core Compression Middleware

This post is about using Response Compression Middleware in ASP.NET Core. Long back I wrote blog post on Enabling GZip Compression in ASP.NET5. It was a custom middleware I implemented in DNX days. Now as part of ASP.NET Core 1.1 Preview 1, Microsoft introduced Response Compression Middleware in ASP.NET Core.

Using WebListener in ASP.NET Core

October 25, 2016 by Anuraj

C# ASP.NET Core WebListener

This post is about using WebListener server in ASP.NET Core. WebListener is a web server for ASP.NET Core based on the Windows Http Server API. WebListener is a Windows-only HTTP server for ASP.NET Core. It runs directly on the Http.Sys kernel driver, and has very little overhead. WebListener cannot be used with the ASP.NET Core Module for IIS. It can only be used independently. Kestrel is designed to be run behind a proxy (for example IIS or Nginx) and should not be deployed directly facing the Internet.

Implementing dotnet ef database update command in MySql

October 13, 2016 by Anuraj

C# ASP.NET Core MySql EF Migrations

This post is about implementing dotnet ef database update command with MySql connector (MySql.Data.EntityFrameworkCore). Few days back I did a post on using MySql in ASP.NET Core. But one problem I found was when calling dotnet ef database update command, the lib was throwing not implemented exception. I had a discussion with @RuAnt, and I found the github repo - https://github.com/mysql/mysql-connector-net. As I got some time today, I thought of exploring the source and implementing the same, if it is not complex. :) So as a first step, I looked into the Sqlite and SqlServer implementations, and from the exception stack, I come to know about the method, which is not implemented.

Enable Code Analysis on ASP.NET Core applications

October 11, 2016 by Anuraj

C# ASP.NET Core dotnet core StyleCop

This post is about enabling stylecop code analysis on ASP.NET Core applications. StyleCop is an open source static code analysis tool from Microsoft that checks C# code for conformance to StyleCop’s recommended coding styles and a subset of Microsoft’s .NET Framework Design Guidelines. StyleCop analyzes the source code, allowing it to enforce a different set of rules from FxCop (which, instead of source code, checks .NET managed code assemblies). StyleCop Analyzers can be used in dotnet cli projects, including asp.net core. The tooling support is currently not great and the analyzers only run when the project is compiled, and there is currently no way to invoke the code fixes. Stylecop Analyzers will work in ubuntu on coreclr and OSX (probably).

Using scaffolding to create ASP.NET Core applications

October 01, 2016 by Anuraj

C# ASP.NET Core Scaffolding

This post is about using scaffolding to create ASP.NET Core applications. Scaffolding is a technique supported by some model–view–controller frameworks, in which the programmer can specify how the application database may be used. The compiler or framework uses this specification, together with pre-defined code templates, to generate the final code that the application can use to create, read, update and delete database entries, effectively treating the templates as a scaffold on which to build a more powerful application.

Copyright © 2024 Anuraj. Blog content licensed under the Creative Commons CC BY 2.5 | Unless otherwise stated or granted, code samples licensed under the MIT license. This is a personal blog. The opinions expressed here represent my own and not those of my employer. Powered by Jekyll. Hosted with ❤ by GitHub