A scientist shouldn’t be asked to judge the economic and moral value of his work. All we should ask the scientist to do is find the truth and then not keep it from anyone
“Arthur Kornberg”
The email address is not a required field by default and you have total control over which fields are saved. The only way the email is saved is if you have an email field in a View, use the field to populate the ApplicationUser email property, and invoke
userManager,CreateAsync.
when I try to provide null email to my API i get this error,
warn: Microsoft.AspNetCore.Identity.UserManager[13]
User b42759d5-8085-4d35-b309-c82111bf4f50 validation failed: InvalidUserName;InvalidEmail.
I know that my email is getting validated, how can I work around it? I want the global setup to validate the email, I just want to disable it for a single menthod
A scientist shouldn’t be asked to judge the economic and moral value of his work. All we should ask the scientist to do is find the truth and then not keep it from anyone
“Arthur Kornberg”
A scientist shouldn’t be asked to judge the economic and moral value of his work. All we should ask the scientist to do is find the truth and then not keep it from anyone
“Arthur Kornberg”
Member
117 Points
241 Posts
is it possible to adjust Identity validation rules for single method?
Apr 21, 2018 05:35 AM|Embryologist|LINK
I have default setup for my Identity at startup. can I change certain rules at a method level,
i.e I want to be able to create a user without email just for the method below?
“Arthur Kornberg”
All-Star
53631 Points
23989 Posts
Re: is it possible to adjust Identity validation rules for single method?
Apr 21, 2018 10:52 AM|mgebhard|LINK
The email address is not a required field by default and you have total control over which fields are saved. The only way the email is saved is if you have an email field in a View, use the field to populate the ApplicationUser email property, and invoke userManager,CreateAsync.
Can you explain the problem you are having?
Member
117 Points
241 Posts
Re: is it possible to adjust Identity validation rules for single method?
Apr 22, 2018 03:23 AM|Embryologist|LINK
this is my setup at starup
when I try to provide null email to my API i get this error,
I know that my email is getting validated, how can I work around it? I want the global setup to validate the email, I just want to disable it for a single menthod
“Arthur Kornberg”
Member
117 Points
241 Posts
Re: is it possible to adjust Identity validation rules for single method?
Apr 22, 2018 06:29 AM|Embryologist|LINK
So I figured out that `CreateAsync` method will run `validateAsync` auto and validate according to my setup.
my workaround, which suites my case here, is just to insert a record directly using dbContext,
this is in my repository, and I call it in my controller after injecting the interface,
My controller
“Arthur Kornberg”