The Story of My Life

Diary of a noob programmer

Category: Programming

Swagger and Authentication in ASP.NET MVC Core

Hello people,   Few day ago my co-worker said how should I specify token for user, well the story goes as: When I enter this company (“Omidan Hozoor Javan”) they used a GUID as a token, and when i explained that it’s not safe, they said our users have no understanding of programming or hacking

Entity Framework Core And Global Filters

There are times in EF Core which you may want to put a global filter on all your models, or some of them. And to do that, reflection is our weapon through the scary path. In my case, I had several entity of which i didn’t wanted to delete them, so I had to go

Access to ASP.NET Core MVC registered Autofac Container

TL;DR; It isn’t long, since i struggle to find out how to access DI registered classes in MVC using autofac, and I failed every time, with every phrase. So, two days ago, I though to myself, let create access point, and it worked. cool, right? The way i gonna show you, is not officially provided

Access dynamic data in master layout and partials in .Net Core

Few day ago, I was searching desperately to access my user context within my Partial Views; during the way I found ways to do it using ASP.NET MVC, but none worked neither existed in ASP.NET Core MVC. I just wanted to share those few ways, although they may still disappoint you and each of which

HTML Tree-View Check-List using jQuery

Some days ago my co-worker who i report to, asked me to create a table of check-list, with data that had tree (hierarchy) form. So I thought let use a tree-view component, but non of starting linked came to my liking, and meanwhile I was thinking about how it may be easy to create a

Turn a List into a Hierarchy Structure of Same Type

Scenario There are cases we have a list of items, and these items should get connected in a tree structure. In case those item declared an empty collection of children, this algorithm is one way to go. Code The following code is the helper i wrote. /// <summary> /// Links a collection of flat node

Fetch Self Referencing data in EF-Core

TL;DR Before i begin, let me tell you about my works. I did so many things and got my hand dirty with any thing you may imagine. but not much when it came to tools most people are familiar with. MVC, jQuery,  … were something everybody enjoyed, but I hardly got along with it. and