forked from MicrosoftDocs/mslearn-tailspin-spacegame-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate from Newtonsoft.Json to System.Text.Json
- Loading branch information
Showing
5 changed files
with
13 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
using Newtonsoft.Json; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace TailSpin.SpaceGame.Web.Models | ||
{ | ||
public class Profile : Model | ||
{ | ||
// The player's user name. | ||
[JsonProperty(PropertyName = "userName")] | ||
[JsonPropertyName("userName")] | ||
public string UserName { get; set; } | ||
|
||
// The URL of the player's avatar image. | ||
[JsonProperty(PropertyName = "avatarUrl")] | ||
[JsonPropertyName("avatarUrl")] | ||
public string AvatarUrl { get; set; } | ||
|
||
// The achievements the player earned. | ||
[JsonProperty(PropertyName = "achievements")] | ||
[JsonPropertyName("achievements")] | ||
public string[] Achievements { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
using Newtonsoft.Json; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace TailSpin.SpaceGame.Web.Models | ||
{ | ||
public class Score : Model | ||
{ | ||
// The ID of the player profile associated with this score. | ||
[JsonProperty(PropertyName = "profileId")] | ||
[JsonPropertyName("profileId")] | ||
public string ProfileId { get; set; } | ||
|
||
// The score value. | ||
[JsonProperty(PropertyName = "score")] | ||
[JsonPropertyName("score")] | ||
public int HighScore { get; set; } | ||
|
||
// The game mode the score is associated with. | ||
[JsonProperty(PropertyName = "gameMode")] | ||
[JsonPropertyName("gameMode")] | ||
public string GameMode { get; set; } | ||
|
||
// The game region (map) the score is associated with. | ||
[JsonProperty(PropertyName = "gameRegion")] | ||
[JsonPropertyName("gameRegion")] | ||
public string GameRegion { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters