Should I use `UserName` or `Username` with `ApplicationUser` in Episerver?

  • Page Owner: Not Set
  • Last Reviewed: 2019-06-13

In Episerver's Identity Framework integration, ApplicationUser has both a UserName and Username property. Which should I use? Or should I use both?


Answer

You can use either. The Username property of ApplicationUser is just a wrapper around the UserName property of the base IdentityUser class. This is likely to satisfy the requirements of the IUIUser interface, which probably had this property prior to the Identity Framework integration.

Decompiled ApplicationUser code showing that Username is a wrapper around UserName