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
Month: August 2020
Evil Code #011 : Tuples
It has been long since I wrote a post in Evil Code series. So here is a short one, using the Tuples which was introduced in C# 7.X. "introduced in C# 7.x" . You must be wondering why I used that phrase. Tuples was there before 7.x right ? Well, the answer is both yes and no. Tuples … Continue reading Evil Code #011 : Tuples
Real World Demo Applications
One of the recent projects I started on Github is NT - my own version of Thinkster's Real World repos. The idea, much like the original idea, is to pick up a project topic and implement it in every language/framework i learn. As a beginning, I have created the Web API using .Net 5 Preview … Continue reading Real World Demo Applications
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