Asp.Net Identity 2 duplicate username check -
Asp.Net Identity 2 duplicate username check -
usermanager in asp.net identity 2 prevents creation user duplicate username through additional request database find possible duplicate. think error prone , can cause concurrency errors. right mechanism should rely on on unique constraints or indexes. wrong , miss something?
links source: createasync , validateusername
no, not wrong. , identity adds unique index on username column:
and migration code table is:
createtable( "dbo.aspnetusers", c => new { id = c.string(nullable: false, maxlength: 128), /* .... snip .... */ username = c.string(nullable: false, maxlength: 256), }) .primarykey(t => t.id) .index(t => t.username, unique: true, name: "usernameindex");
unique index set on column.
p.s. looking on identity v3 - not released. current identity v2.1 not open source yet.
asp.net asp.net-identity
Comments
Post a Comment