Using three.js with ASP.NET Core Blazor Server application

If you know C# and you want to create a cool modern web application… But you are too lazy have no desire or have no ability to learn any front-end things like JavaScript and JavaScript-based frameworks… Then probably the best choice for you is a new Microsoft framework called Blazor.

As the official documentation says Blazor was developed for “Create rich interactive UIs using C# instead of JavaScript”. And it sounds actually cool. No more JavaScript, no more “spaghetti code”, no more callbacks and other scary things 🙂

But, wait. What about 2D or 3D graphics like canvas or WebGL? Does Blazor support them? Hmmm… It seems like we still have to use some JavaScript libraries similar to three.js or Babylon.js.

So, it’s quite amusing subject to investigate. Let’s try.

Continue reading “Using three.js with ASP.NET Core Blazor Server application”

Initial adding admin roles and users to the database for Role-based authorization in the ASP.NET Core 3.1 MVC applications

There is a really good article in the official ASP.NET Core documentation, which explains how to apply role restrictions to your controller actions. But after reading, it still was hard for me to get answers for a couple of questions:

  • How to seed initial records of the users and roles to the database?
  • And how to assign the new user to the default role?

Let’s find out what we can do.

Continue reading “Initial adding admin roles and users to the database for Role-based authorization in the ASP.NET Core 3.1 MVC applications”