asp.net mvc - Identity 2 how to allow dupicate Names for logical deletes -
how can identity 2 allow more 1 user same name?
in application don't want physically delete user database. have added delete flag users table.
then dropped index required username
unique. , created filtered index ix_user_delet_fg_flase
dropindex("dbo.users", "usernameindex on dbo.user"); sql("create unique index ix_user_delet_fg_flase on dbo.users (username) deletefg = 0");
the index checks if name unique when deleted flag false.
this still didn't allow me create user same name deleted user. looking @ source code identity source there private method checks if name unique. there way disable validation ?
or need overwrite of identity methods check user delete flag false.
has done before, lot of work or better way ?
i'm afraid if start doing i'm going end down big rabbit hole
you correct rabbit hole - if start digging it, you'll end lot of code purpose. easy way logical deletes append suffix end of username, duplication not happen.
i'm thinking suffix should contain random value well, can delete same user multiple times.
Comments
Post a Comment