Propose alternative to defining redundant class property

This commit is contained in:
LumaLivy 2021-11-08 13:50:56 -05:00
parent 06f0d7a96f
commit ac8e1dc303

View file

@ -52,12 +52,6 @@ namespace LBPUnion.ProjectLighthouse.Types.Levels
[ForeignKey(nameof(CreatorId))]
public User Creator { get; set; }
[NotMapped]
public string CreatorName
{
get => this.Creator?.Username;
}
/// <summary>
/// The location of the level on the creator's earth
/// </summary>
@ -156,7 +150,7 @@ namespace LBPUnion.ProjectLighthouse.Types.Levels
string slotData = LbpSerializer.StringElement("name", this.Name) +
LbpSerializer.StringElement("id", this.SlotId) +
LbpSerializer.StringElement("game", (int)this.GameVersion) +
LbpSerializer.StringElement("npHandle", this.CreatorName) +
LbpSerializer.StringElement("npHandle", this.Creator?.Username) +
LbpSerializer.StringElement("description", this.Description) +
LbpSerializer.StringElement("icon", this.IconHash) +
LbpSerializer.StringElement("rootLevel", this.RootLevel) +