Blog

Blog posts on .NET, Azure, and more.

How to use Bootstrap style validation in ASP.NET Core

October 20, 2019 by Anuraj

ASPNET Core Bootstrap

This post is about using Bootstrap 4 style validation in ASP.NET Core. By default ASP.NET Core validation messages will be displayed in the bottom of the invalid control. And even if we are using bootstrap, the validation styles won’t be applied. In this post I will explain how to configure Bootstrap validation styles to ASP.NET Core.

Write your first GitHub action - Part 3

September 01, 2019 by Anuraj

CI GitHub Actions ASPNET Core

In the last post we learned about deploying a NuGet package to nuget.org using dotnet nuget push command. In this post, we will learn how to deploy an ASP.NET Core Web API application to Azure App Service.

Write your first GitHub action - Part 2

August 25, 2019 by Anuraj

CI GitHub Actions ASPNET Core

In the last post we learned about working with GitHub actions and creating a CI workflow for our dotnet core application. In this post, we will learn how to deploy the middleware to nuget.org using dotnet nuget push command.

Write your first GitHub action - Part 1

August 19, 2019 by Anuraj

CI GitHub Actions ASPNET Core

GitHub Actions makes it easy to automate all your software workflows. GitHub actions is still in Beta and it is free for Open source projects. This post is writing your first GitHub action for implementing continuous integration for a dotnet core application. Similar to Azure DevOps or Travis CI, it is also supports YAML scripts to implement automation.

How to Mock Entity Framework DbContext for Unit Testing

August 06, 2019 by Anuraj

EFCore UnitTesting

This post is about how to mock entity framework DbContext class for unit testing without any third party framework. The dotnet core framework designed and developed considering testability of the apps in mind. Usually for testing the applications which interacts with database, we used to follow two approaches 1) We will be using a repository layer to interact with Database and using any mock framework (without a mocking framework also we can implement it.), we will mock the repository and test the application. 2) Use In Memory Database provider instead of the actual database provider. In this post, I am showing the second approach, the actual code is using SQL Server provider. And for unit testing I am using In Memory provider for EF Core.

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