Use {get;set;} defaults for User and Slot

This commit is contained in:
jvyden 2021-10-19 14:58:10 -04:00
commit fcd1f25084
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
4 changed files with 6 additions and 9 deletions

View file

@ -43,13 +43,12 @@ namespace ProjectLighthouse.Controllers {
//TODO: parse location in body
Location l = new() {
X = 0,
Y = 0
Y = 0,
};
database.Locations.Add(l);
await database.SaveChangesAsync();
slot.LocationId = l.Id;
slot.CreatorId = user.UserId;
if(slot.BackgroundHash == null) slot.BackgroundHash = "";
database.Slots.Add(slot);
await database.SaveChangesAsync();

View file

@ -28,8 +28,6 @@ namespace ProjectLighthouse {
Username = username,
LocationId = l.Id,
Biography = username + " hasn't introduced themselves yet.",
Pins = "",
PlanetHash = "",
};
this.Users.Add(user);

View file

@ -67,7 +67,7 @@ namespace ProjectLighthouse.Types {
public string AuthorLabels { get; set; }
[XmlElement("background")]
public string BackgroundHash { get; set; }
public string BackgroundHash { get; set; } = "";
[XmlElement("minPlayers")]
public int MinimumPlayers { get; set; }

View file

@ -34,12 +34,12 @@ namespace ProjectLighthouse.Types {
public int FavouriteSlotCount { get; set; }
public int FavouriteUserCount { get; set; }
public int LolCatFtwCount { get; set; }
public string Pins { get; set; }
public string Pins { get; set; } = "";
public int StaffChallengeGoldCount { get; set; }
public int StaffChallengeSilverCount { get; set; }
public int StaffChallengeBronzeCount { get; set; }
public string PlanetHash { get; set; }
public string PlanetHash { get; set; } = "";
// [NotMapped]
public readonly ClientsConnected ClientsConnected = new();