mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-10-14 17:54:42 +00:00
24 lines
899 B
C#
24 lines
899 B
C#
using Domain.Entities;
|
|
|
|
namespace Features.Users.Identity;
|
|
|
|
/// <summary>
|
|
/// Converts the persistence-agnostic <see cref="UserAccount" /> domain entity into the
|
|
/// <see cref="ApplicationUser" /> shape required by <see cref="Microsoft.AspNetCore.Identity.UserManager{TUser}" />.
|
|
/// Kept here, in Features.Users, rather than on <see cref="UserAccount" /> itself so the domain layer has
|
|
/// no dependency on ASP.NET Core Identity.
|
|
/// </summary>
|
|
public static class UserAccountExtensions
|
|
{
|
|
public static ApplicationUser ToApplicationUser(this UserAccount userAccount) =>
|
|
new()
|
|
{
|
|
Id = userAccount.UserAccountId,
|
|
UserName = userAccount.Username,
|
|
Email = userAccount.Email,
|
|
FirstName = userAccount.FirstName,
|
|
LastName = userAccount.LastName,
|
|
DateOfBirth = userAccount.DateOfBirth,
|
|
};
|
|
}
|