In the last blog we learned how we can use JWT token in angular & .NET Core application there we have seen to pass the generated token we changed in a service call.

Changing the service call for adding something in the request header is not a good solution because if you want to add some new service, you need to add header changes also in that service.

To overcome this problem we need some solution where we are allowed to access every request and make changes in request calls and this is what exactly HTTP interceptors do.

The angular…


Kindly check below article if you are not familiar with JWT token how it is generated in .net core.

This article is an extension to a previous article where we are going to see how we can use generated JWT token with angular so stay tuned and follow the below steps if you want to use JWT token in your application,

Step 1 Create an angular application with .net Core.

Go to visual studio 2019 -> Create New Project -> Asp.Net Core Web Application -> Select Angular Template -> Finish.

Check the image below so if you see project…


In this article, we are going to look for cache bursting techniques in .NET MVC and .NET Core,

When a browser requests the server to get a static file, the browser will download this file, and then it will cache them to improve & optimize performance. Doing this caching helps the browser not to download files on every request and use cached files. This caching is one of the most important things to do when optimizing websites which ultimately saves a lot of data for end uses/visitors. Optimizing the website performance includes setting up the long expiration dates for the…


In today’s article, we will look into converting your HTML page into a PDF using Rotativa also we will look into saving that file in a particular location.

Rotativa is an open-source package available in NuGet Package Manager using which We can easily generate the pdf file. Rotativa uses the web kit engine which is used by Chrome browser to render the HTML. Most of the HTML tags and styles are supported by this framework. The Rotativa framework provides Rotativa namespace. This namespace contains the following classes,

i) ActionAsPdf — This method accepts the action name as a string parameter…


In this article, we will explore the basic about unit testing in angular,

Unit Testing

When you are developing any software that software goes through different types of testing (Unit Testing, Integration Testing, End to End Testing, etc.) after completing all types of testing only software is going to run in the production environment. A lot of confusion between developers on when to start testing software. The right way is to start testing software when you are developing it and the type of testing is called Unit Testing. Now next question may be what unit testing is,

Unit testing breaks…


In this article, we will look into how we can use XML parameters in Stored Procedure and what are benefits of it,

You might be thinking what kind of situations are there where we prefer to pass data as XML below are some of the scenarios,

1) Consider a scenario where you have table data in datatable / dataset and you want to perform some kind of operation on individual record so you have two approaches to solving this first one is you can loop till data exists in the datatable / dataset and perform some kind of operation on…


In this article, we will explore windows authentication in Blazor so follow the below steps along with me,

Note -: I recommend you check out the previous article on the blazor series.

Step 1) Install the required NuGet package required for authorization

Right click on project-> Manage NuGet packages -> Search for Microsoft.AspNetCore.Components.Authorization -> install

NuGet Installation

Step 2) Make the required changes in ConfigureServices in Startup.cs class

Add services.AddAuthorizationCore() which will add all the necessary authorization services required for authorization to work in blazor application.

public void ConfigureServices(IServiceCollection services){services.AddRazorPages();services.AddServerSideBlazor();services.AddHttpClient<IProductService, ProductService>(client =>{client.BaseAddress = new Uri(“https://localhost:44340/");});


In this article, we will see how to consume REST API calls inside blazor application,

Initially, we are loading the data by hard coding the values in component base file lets look at the code for that,

Productlist.razor

@page “/”@inherits ProductlistBase<h3>Productlist</h3>@if (Products == null){<div class=”spinner”></div>}else{<div>@foreach (var product in Products){<span>Product Id: @product.productId</span><span>Product Name: @product.ProductName</span><br/>}</div>}

ProductlistBase.cs

using Microsoft.AspNetCore.Components;using System;using System.Collections.Generic;using System.Linq;using System.Threading.Tasks;namespace EmployeeManagement.Web.Pages{public class ProductlistBase:ComponentBase{public IEnumerable<Product> Products { get; set; }protected override async Task OnInitializedAsync()

In this article, We will explore REST API Calls in .NET Core,

1) Get List of resources

For creating REST API methods we are creating a controller that derives from the ControllerBase class.

On thing over here when you are working with a web API project derive your controller class from ControllerBase only and not from Controller as Controller adds support for view object So class derived from the controller when working with and MVC web application.

Let's see an example of retrieving the product list,

ProductController.cs

using System;using System.Collections.Generic;using System.Linq;using System.Threading.Tasks;using EmployeeManagement.API.Model;using Microsoft.AspNetCore.Http;using…


Repository pattern is an abstraction to the data access layer it hides the details about how data is saved or retrieved from the underlying data source the details about how the data is retrieved is present in the repository. You may have different repositories based on how you want to retrieve data from different data sources.

For doing this you need to define an interface let’s look into the following example,

IProductRepository.cs

using System;using System.Collections.Generic;using System.Linq;using System.Threading.Tasks;namespace EmployeeManagement.API.Model{public interface IProductRepository{Task<IEnumerable<Product>> GetProducts();Task<Product> GetProduct(int id);Task<Product> AddProduct(Product product);Task<Product> UpdateProduct(Product product);void DeleteProduct(int…

Vaibhav Bhapkar

Technical Speaker | Computer Engineer | Full Stack Web Developer | ML Enthusiast | * Knowledge Shared = Knowledge² *

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store