mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-10-14 17:54:42 +00:00
Features/public biography endpoint (#316)
This commit is contained in:
@@ -6,6 +6,15 @@ namespace Features.Users.Dtos;
|
||||
public static class UserDtoMapper
|
||||
{
|
||||
/// <summary>Converts a user account into its public-profile representation.</summary>
|
||||
public static PublicUserProfileDto ToPublicProfileDto(this UserAccount user) =>
|
||||
new(user.UserAccountId, user.Username, user.FirstName, user.LastName, user.CreatedAt);
|
||||
public static PublicUserProfileDto ToPublicProfileDto(this UserAccount user)
|
||||
{
|
||||
return new PublicUserProfileDto(
|
||||
UserAccountId : user.UserAccountId,
|
||||
Username : user.Username,
|
||||
FirstName : user.FirstName,
|
||||
LastName : user.LastName,
|
||||
Biography : user.UserProfile?.Biography ?? string.Empty,
|
||||
CreatedAt : user.CreatedAt
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user