-
Hi, I need to know how to create a user in orchard core CMS with custom properties using CreateUserAsync function |
Beta Was this translation helpful? Give feedback.
Answered by
hishamco
Jan 10, 2024
Replies: 1 comment 18 replies
-
This is a code snippet I used in one of my projects IUser user = new User
{
UserName = "hishamco",
Email = "[email protected]"
IsEnabled = true,
RoleNames = new List<string> { "Administrators" },
Properties = new JObject
{
{ "Property1", "Value1" },
{ "Property2", "Value2" },
}
};
await _userService.CreateUserAsync(user, "P@ssw0rd", ModelState.AddModelError); |
Beta Was this translation helpful? Give feedback.
18 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
FYI https://github.com/OrchardCMS/OrchardCore/blob/main/src/OrchardCore.Modules/OrchardCore.ContentFields/Fields/TextField.cs