Skip to content

Commit 40b2a89

Browse files
donkerbdukes
authored andcommitted
Ensure no expression-bodies properties in DTO objects
1 parent 6e1385a commit 40b2a89

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Users/Dto/UserBasicDto.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ public UserBasicDto(UserInfo user)
3232
this.HasAgreedToTerms = user.HasAgreedToTerms;
3333
this.RequestsRemoval = user.RequestsRemoval;
3434
this.IsSuperUser = user.IsSuperUser;
35-
this.IsAdmin = user.Roles.Contains(this.PortalSettings.AdministratorRoleName);
35+
this.IsAdmin = user.Roles.Contains(this.PortalSettings.AdministratorRoleName);
36+
this.AvatarUrl = Utilities.GetProfileAvatar(this.UserId);
3637
}
3738

3839
[DataMember(Name = "avatar")]
39-
public string AvatarUrl => Utilities.GetProfileAvatar(this.UserId);
40+
public string AvatarUrl { get; set; }
4041

4142
[DataMember(Name = "userId")]
4243
public int UserId { get; set; }

Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Users/Dto/UserDetailDto.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,16 @@ public UserDetailDto(UserInfo user) : base(user)
4848
this.HasUserFiles = files.Any();
4949
}
5050

51-
this.HasAgreedToTermsOn = user.HasAgreedToTermsOn;
51+
this.HasAgreedToTermsOn = user.HasAgreedToTermsOn;
52+
this.ProfileUrl = this.UserId > 0 ? Globals.UserProfileURL(this.UserId) : null;
53+
this.EditProfileUrl = this.UserId > 0 ? GetSettingUrl(this.PortalId, this.UserId) : null;
5254
}
5355

5456
[DataMember(Name = "profileUrl")]
55-
public string ProfileUrl => this.UserId > 0 ? Globals.UserProfileURL(this.UserId) : null;
57+
public string ProfileUrl { get; set; }
5658

5759
[DataMember(Name = "editProfileUrl")]
58-
public string EditProfileUrl => this.UserId > 0 ? GetSettingUrl(this.PortalId, this.UserId) : null;
60+
public string EditProfileUrl { get; set; }
5961

6062
[DataMember(Name = "lastLogin")]
6163
public DateTime LastLogin { get; set; }

0 commit comments

Comments
 (0)