File tree Expand file tree Collapse file tree 10 files changed +126
-62
lines changed Expand file tree Collapse file tree 10 files changed +126
-62
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "version" : " 0.2.0" ,
3
+ "configurations" : [
4
+ {
5
+ // Use IntelliSense to find out which attributes exist for C# debugging
6
+ // Use hover for the description of the existing attributes
7
+ // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
8
+ "name" : " .NET Core Launch (web)" ,
9
+ "type" : " coreclr" ,
10
+ "request" : " launch" ,
11
+ "preLaunchTask" : " build" ,
12
+ // If you have changed target frameworks, make sure to update the program path.
13
+ "program" : " ${workspaceFolder}/Tailspin.SpaceGame.Web/bin/Debug/net5.0/Tailspin.SpaceGame.Web.dll" ,
14
+ "args" : [],
15
+ "cwd" : " ${workspaceFolder}/Tailspin.SpaceGame.Web" ,
16
+ "stopAtEntry" : false ,
17
+ // Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
18
+ "serverReadyAction" : {
19
+ "action" : " openExternally" ,
20
+ "pattern" : " \\ bNow listening on:\\ s+(https?://\\ S+)"
21
+ },
22
+ "env" : {
23
+ "ASPNETCORE_ENVIRONMENT" : " Development"
24
+ },
25
+ "sourceFileMap" : {
26
+ "/Views" : " ${workspaceFolder}/Views"
27
+ }
28
+ },
29
+ {
30
+ "name" : " .NET Core Attach" ,
31
+ "type" : " coreclr" ,
32
+ "request" : " attach" ,
33
+ "processId" : " ${command:pickProcess}"
34
+ }
35
+ ]
36
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "version" : " 2.0.0" ,
3
+ "tasks" : [
4
+ {
5
+ "label" : " build" ,
6
+ "command" : " dotnet" ,
7
+ "type" : " process" ,
8
+ "args" : [
9
+ " build" ,
10
+ " ${workspaceFolder}/Tailspin.SpaceGame.Web/Tailspin.SpaceGame.Web.csproj" ,
11
+ " /property:GenerateFullPaths=true" ,
12
+ " /consoleloggerparameters:NoSummary"
13
+ ],
14
+ "problemMatcher" : " $msCompile"
15
+ },
16
+ {
17
+ "label" : " publish" ,
18
+ "command" : " dotnet" ,
19
+ "type" : " process" ,
20
+ "args" : [
21
+ " publish" ,
22
+ " ${workspaceFolder}/Tailspin.SpaceGame.Web/Tailspin.SpaceGame.Web.csproj" ,
23
+ " /property:GenerateFullPaths=true" ,
24
+ " /consoleloggerparameters:NoSummary"
25
+ ],
26
+ "problemMatcher" : " $msCompile"
27
+ },
28
+ {
29
+ "label" : " watch" ,
30
+ "command" : " dotnet" ,
31
+ "type" : " process" ,
32
+ "args" : [
33
+ " watch" ,
34
+ " run" ,
35
+ " ${workspaceFolder}/Tailspin.SpaceGame.Web/Tailspin.SpaceGame.Web.csproj" ,
36
+ " /property:GenerateFullPaths=true" ,
37
+ " /consoleloggerparameters:NoSummary"
38
+ ],
39
+ "problemMatcher" : " $msCompile"
40
+ }
41
+ ]
42
+ }
Original file line number Diff line number Diff line change 4
4
using System . Linq ;
5
5
using System . Linq . Expressions ;
6
6
using System . Threading . Tasks ;
7
- using Newtonsoft . Json ;
7
+ using System . Text . Json ;
8
8
using TailSpin . SpaceGame . Web . Models ;
9
9
10
10
namespace TailSpin . SpaceGame . Web
@@ -17,7 +17,7 @@ public class LocalDocumentDBRepository<T> : IDocumentDBRepository<T> where T : M
17
17
public LocalDocumentDBRepository ( string fileName )
18
18
{
19
19
// Serialize the items from the provided JSON document.
20
- _items = JsonConvert . DeserializeObject < List < T > > ( File . ReadAllText ( fileName ) ) ;
20
+ _items = JsonSerializer . Deserialize < List < T > > ( File . ReadAllText ( fileName ) ) ;
21
21
}
22
22
23
23
/// <summary>
Original file line number Diff line number Diff line change 1
- using Newtonsoft . Json ;
1
+ using System . Text . Json . Serialization ;
2
2
3
3
namespace TailSpin . SpaceGame . Web . Models
4
4
{
@@ -8,7 +8,7 @@ namespace TailSpin.SpaceGame.Web.Models
8
8
public abstract class Model
9
9
{
10
10
// The value that uniquely identifies this object.
11
- [ JsonProperty ( PropertyName = "id" ) ]
11
+ [ JsonPropertyName ( "id" ) ]
12
12
public string Id { get ; set ; }
13
13
}
14
14
}
Original file line number Diff line number Diff line change 1
- using Newtonsoft . Json ;
1
+ using System . Text . Json . Serialization ;
2
2
3
3
namespace TailSpin . SpaceGame . Web . Models
4
4
{
5
5
public class Profile : Model
6
6
{
7
7
// The player's user name.
8
- [ JsonProperty ( PropertyName = "userName" ) ]
8
+ [ JsonPropertyName ( "userName" ) ]
9
9
public string UserName { get ; set ; }
10
10
11
11
// The URL of the player's avatar image.
12
- [ JsonProperty ( PropertyName = "avatarUrl" ) ]
12
+ [ JsonPropertyName ( "avatarUrl" ) ]
13
13
public string AvatarUrl { get ; set ; }
14
14
15
15
// The achievements the player earned.
16
- [ JsonProperty ( PropertyName = "achievements" ) ]
16
+ [ JsonPropertyName ( "achievements" ) ]
17
17
public string [ ] Achievements { get ; set ; }
18
18
}
19
19
}
Original file line number Diff line number Diff line change 1
- using Newtonsoft . Json ;
1
+ using System . Text . Json . Serialization ;
2
2
3
3
namespace TailSpin . SpaceGame . Web . Models
4
4
{
5
5
public class Score : Model
6
6
{
7
7
// The ID of the player profile associated with this score.
8
- [ JsonProperty ( PropertyName = "profileId" ) ]
8
+ [ JsonPropertyName ( "profileId" ) ]
9
9
public string ProfileId { get ; set ; }
10
10
11
11
// The score value.
12
- [ JsonProperty ( PropertyName = "score" ) ]
12
+ [ JsonPropertyName ( "score" ) ]
13
13
public int HighScore { get ; set ; }
14
14
15
15
// The game mode the score is associated with.
16
- [ JsonProperty ( PropertyName = "gameMode" ) ]
16
+ [ JsonPropertyName ( "gameMode" ) ]
17
17
public string GameMode { get ; set ; }
18
18
19
19
// The game region (map) the score is associated with.
20
- [ JsonProperty ( PropertyName = "gameRegion" ) ]
20
+ [ JsonPropertyName ( "gameRegion" ) ]
21
21
public string GameRegion { get ; set ; }
22
22
}
23
23
}
Original file line number Diff line number Diff line change 1
- using Microsoft . AspNetCore . Builder ;
1
+ using System ;
2
+ using System . Collections . Generic ;
3
+ using System . Linq ;
4
+ using System . Threading . Tasks ;
5
+ using Microsoft . AspNetCore . Builder ;
2
6
using Microsoft . AspNetCore . Hosting ;
3
- using Microsoft . AspNetCore . Http ;
4
7
using Microsoft . AspNetCore . HttpsPolicy ;
5
8
using Microsoft . Extensions . Configuration ;
6
9
using Microsoft . Extensions . DependencyInjection ;
7
10
using Microsoft . Extensions . Hosting ;
8
- using System ;
9
- using System . Collections . Generic ;
10
- using System . Linq ;
11
- using System . Threading . Tasks ;
12
11
using TailSpin . SpaceGame . Web . Models ;
12
+ using Microsoft . AspNetCore . Http ;
13
+
13
14
14
15
namespace TailSpin . SpaceGame . Web
15
16
{
Original file line number Diff line number Diff line change 1
1
<Project Sdk =" Microsoft.NET.Sdk.Web" >
2
2
3
3
<PropertyGroup >
4
- <TargetFramework >netcoreapp3.1 </TargetFramework >
4
+ <TargetFramework >net5.0 </TargetFramework >
5
5
<ProjectGuid >{A0C4E31E-AC75-4F39-9F59-0AA19D9B8F46}</ProjectGuid >
6
6
</PropertyGroup >
7
7
8
- <ItemGroup >
9
- <PackageReference Include =" Newtonsoft.Json" Version =" 12.0.1" />
10
- </ItemGroup >
11
-
12
8
<ItemGroup >
13
9
<Folder Include =" wwwroot\images\avatars\" />
14
10
</ItemGroup >
15
- </Project >
11
+ </Project >
Original file line number Diff line number Diff line change @@ -11,17 +11,17 @@ stages:
11
11
- job : ' Build'
12
12
displayName : ' Build job'
13
13
pool :
14
- vmImage : ' ubuntu-18 .04'
14
+ vmImage : ' ubuntu-20 .04'
15
15
demands :
16
16
- npm
17
17
18
18
variables :
19
19
wwwrootDir : ' Tailspin.SpaceGame.Web/wwwroot'
20
- dotnetSdkVersion : ' 3.1.300 '
20
+ dotnetSdkVersion : ' 5.x '
21
21
22
22
steps :
23
23
- task : UseDotNet@2
24
- displayName : ' Use .NET Core SDK $(dotnetSdkVersion)'
24
+ displayName : ' Use .NET SDK $(dotnetSdkVersion)'
25
25
inputs :
26
26
version : ' $(dotnetSdkVersion)'
27
27
@@ -71,7 +71,7 @@ stages:
71
71
jobs :
72
72
- deployment : Deploy
73
73
pool :
74
- vmImage : ' ubuntu-18 .04'
74
+ vmImage : ' ubuntu-20 .04'
75
75
environment : dev
76
76
variables :
77
77
- group : Release
@@ -94,7 +94,7 @@ stages:
94
94
jobs :
95
95
- deployment : Deploy
96
96
pool :
97
- vmImage : ' ubuntu-18 .04'
97
+ vmImage : ' ubuntu-20 .04'
98
98
environment : test
99
99
variables :
100
100
- group : ' Release'
@@ -117,7 +117,7 @@ stages:
117
117
jobs :
118
118
- deployment : Deploy
119
119
pool :
120
- vmImage : ' ubuntu-18 .04'
120
+ vmImage : ' ubuntu-20 .04'
121
121
environment : staging
122
122
variables :
123
123
- group : ' Release'
You can’t perform that action at this time.
0 commit comments