state after adding all of the user stuff and messing around with the wierd brave bug
This commit is contained in:
29
OpenArchival.Blazor.AdminPages.Shared/UserDto.cs
Normal file
29
OpenArchival.Blazor.AdminPages.Shared/UserDto.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
namespace OpenArchival.Blazor.AdminPages.Shared;
|
||||
|
||||
using OpenArchival.DataAccess;
|
||||
|
||||
public class UserDto
|
||||
{
|
||||
public string Id { get; set; } = "";
|
||||
public string? Username { get; set; }
|
||||
public IEnumerable<string> Roles { get; set; } = new HashSet<string>();
|
||||
public string? Password { get; set; }
|
||||
public string RolesDisplay { get => string.Join(",", Roles); }
|
||||
|
||||
public static ApplicationUser ToApplicationUser(UserDto user)
|
||||
{
|
||||
var newUser = new ApplicationUser
|
||||
{
|
||||
UserName = user.Username,
|
||||
Email = user.Username
|
||||
};
|
||||
|
||||
if (!string.IsNullOrEmpty(user.Id))
|
||||
{
|
||||
newUser.Id = user.Id;
|
||||
}
|
||||
|
||||
return newUser;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user