diff options
Diffstat (limited to 'Timeline/Services/User.cs')
-rw-r--r-- | Timeline/Services/User.cs | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/Timeline/Services/User.cs b/Timeline/Services/User.cs index f63a374e..09a472e5 100644 --- a/Timeline/Services/User.cs +++ b/Timeline/Services/User.cs @@ -1,14 +1,9 @@ -using Microsoft.AspNetCore.Mvc;
-using System;
-using Timeline.Controllers;
-
-namespace Timeline.Services
+namespace Timeline.Services
{
public class User
{
public string? Username { get; set; }
public string? Nickname { get; set; }
- public string? AvatarUrl { get; set; }
#region adminsecret
public bool? Administrator { get; set; }
@@ -20,30 +15,4 @@ namespace Timeline.Services public long? Version { get; set; }
#endregion secret
}
-
- public static class UserExtensions
- {
- public static User EraseSecretAndFinalFill(this User user, IUrlHelper urlHelper, bool adminstrator)
- {
- if (user == null)
- throw new ArgumentNullException(nameof(user));
-
- var result = new User
- {
- Username = user.Username,
- Nickname = user.Nickname,
- AvatarUrl = urlHelper.ActionLink(action: nameof(UserAvatarController.Get), controller: nameof(UserAvatarController), values: new
- {
- user.Username
- })
- };
-
- if (adminstrator)
- {
- result.Administrator = user.Administrator;
- }
-
- return result;
- }
- }
}
|