SecurityService.UpdateUser ArgumentNullException

Hi,

I'm not sure why but user.RoleNames is null when I try to call SecurityService.UpdateUser which generates an ArgumentNullException.

Of course, a user may not have any roles (not in my case) so perhaps there should be something in the Radzen generated code? My work around is to change from

        public async Task<ApplicationUser> UpdateUser(string id, ApplicationUser user)
        {
            var roles = user.RoleNames.ToArray();

to

        public async Task<ApplicationUser> UpdateUser(string id, ApplicationUser user)
        {
            var roles = user.RoleNames != null ? user.RoleNames.ToArray() : Array.Empty<string>();

We will update our code generation to handle your case.

2 Likes