Private Routes using VueJs

Quite often in your application, you could come across when certain pages/routes could be accessed by only authenticated users. And then there are other pages, which could be access be any one. I tend to call them by private routes and public routes. Private Routes requires a certain condition to be met, for example, the user needs to be authenticated. … Continue reading Private Routes using VueJs

Getting started with DocFx

I have been lately pretty impressed with the DocFx, Microsoft's static documentation generator. In this blog post, I thought I would outline how easy it is to configure the DocFx for generating documentation for your project. Assumption : Project already has Xml documentations enabled and the code have the necessary comments. Step 1 : Install … Continue reading Getting started with DocFx

Mocking User.Identity.Name

One of the other issue you might encounter while unit testing your Controller is when you dealing with Identity. Consider the following action method. public async Task<BarResponse> Foo(BarRequest user) { if (ModelState.IsValid) { try { var userName = User.Identity.Name; // Do Task return new BarResponse{ }; } catch (Exception ex) { return new BarResponse { … Continue reading Mocking User.Identity.Name