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 //TODO: parse location in body
Location l = new() { Location l = new() {
X = 0, X = 0,
Y = 0 Y = 0,
}; };
database.Locations.Add(l); database.Locations.Add(l);
await database.SaveChangesAsync(); await database.SaveChangesAsync();
slot.LocationId = l.Id; slot.LocationId = l.Id;
slot.CreatorId = user.UserId; slot.CreatorId = user.UserId;
if(slot.BackgroundHash == null) slot.BackgroundHash = "";
database.Slots.Add(slot); database.Slots.Add(slot);
await database.SaveChangesAsync(); await database.SaveChangesAsync();

View file

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

View file

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

View file

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