(30/30) Everyone learn Blazor together: . NET 6<ErrorBoundary>
Yesterday, we talked about unit testing, but sometimes it may not be possible to fully test due to time constraints.
Yesterday, we talked about unit testing, but sometimes it may not be possible to fully test due to time constraints.
Probably the most boring process of developing a system is to solve bugs, especially the error of trying to value null objects (`Object reference not set to an instance of an object.`). This should be the most common problem that most people encounter when they first step into the programming field. In order to relieve themselves from the boring process of solving bugs, this article introduces 'unit testing'.
A new version of the framework 'Zack.EFCore.Batch' that performs 'updates','deletes', and 'inserts' of data in 'EF Core' has been released. The new version adds support for '. NET 6' and supports 'ValueConverter' when data is inserted in batches, completely solving the 'The count of columns should be even exception that occurs when the expressions of two columns are equivalent' when updating data.
It was mentioned before that 'ASP.NET Core Identity' uses 'Claim' based authentication. In fact,'ASP.NET Core Identity' has different types of authorization methods, the simplest are 'login authorization','role authorization', and 'Claim authorization', but all of the above are implemented in one way: 'Policy-based authorization'.
As mentioned earlier,`ASP.NET Core Identity` is a verification based on `Claim`, and `Role` is a `Claim` of type `Role`
Yesterday, the 'CRUD' functions of the role were completed, and then the role was assigned to the user.
In some cases, you need to dynamically execute C#code during program execution. For example, you need to save certain algorithms that change frequently in a configuration file, and read and perform operations from the configuration file during execution. At this point, you can use C#scripts to do this.
First add a `ViewModel` that carries role data, because the next permissions will be judged based on the role
The day before yesterday, I added verified and failed display content to 'Blog.razor'. However, if the system wants to present the same content that failed to verify, it would be a waste of time to write it in every Component. You can use 'App.razor' to help us do unified presentation.
We mentioned earlier that `UserAuthentication()` and `UserAuthorization()`. The difference between the two is that the former is used to verify who the login person is, and the latter determines what the login person can do.