What is normalized email and username in .NET IdentityUser Model?

When I use the IdentityUser model in Asp.Net Identity with EntityFramework , it creates standard fields in the database. All fields are explanatory except for the following two fields.

  • NormalizedUsername - contains the upper login user name
  • NormalizedEmail - which contains the uppercase Email value

My doubts:

  • Why do we need these normalized fields?
  • What is the purpose of saving to the database?
  • Where are these fields used in the framework?
+6
source share
1 answer

In my opinion, both fields exist for performance reasons. This is explained in the next normalization thread in UserName and Email causing slow performance and are used to test the case insensitivity of UserName and Email . They are stored in the database in order to be able to create an index on them, thus making the search with the usual username and email sargable .

There is no other reason or use of these fields.

+6
source

Source: https://habr.com/ru/post/1013669/


All Articles