Skip to content

Commit 286eea7

Browse files
author
Bart Koelman
authored
Merge pull request #744 from bart-degreed/projects-cleanup
Projects cleanup
2 parents 736c710 + 29ac0de commit 286eea7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+631
-606
lines changed

Build.ps1

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,7 @@ CheckLastExitCode
2727
dotnet build -c Release
2828
CheckLastExitCode
2929

30-
# Workaround: running 'dotnet test -c Release' fails for yet unknown reasons on AppVeyor, so we run tests one by one.
31-
32-
dotnet test ./test/JsonApiDotNetCoreExampleTests/JsonApiDotNetCoreExampleTests.csproj -c Release --no-build
33-
CheckLastExitCode
34-
35-
dotnet test ./test/DiscoveryTests/DiscoveryTests.csproj -c Release --no-build
36-
CheckLastExitCode
37-
38-
dotnet test ./test/IntegrationTests/IntegrationTests.csproj -c Release --no-build
39-
CheckLastExitCode
40-
41-
dotnet test ./test/UnitTests/UnitTests.csproj -c Release --no-build
42-
CheckLastExitCode
43-
44-
dotnet test ./test/NoEntityFrameworkTests/NoEntityFrameworkTests.csproj -c Release --no-build
30+
dotnet test -c Release --no-build
4531
CheckLastExitCode
4632

4733
Write-Output "APPVEYOR_REPO_TAG: $env:APPVEYOR_REPO_TAG"
@@ -62,7 +48,7 @@ If($env:APPVEYOR_REPO_TAG -eq $true) {
6248
}
6349
}
6450
Else {
65-
Write-Output "VERSION-SUFFIX: alpha1-$revision"
51+
Write-Output "VERSION-SUFFIX: alpha5-$revision"
6652
Write-Output "RUNNING dotnet pack .\src\JsonApiDotNetCore -c Release -o .\artifacts --version-suffix=alpha1-$revision"
6753
dotnet pack .\src\JsonApiDotNetCore -c Release -o .\artifacts --version-suffix=alpha1-$revision --include-symbols
6854
CheckLastExitCode

appveyor.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,8 @@ version: '{build}'
22
os: Visual Studio 2019
33

44
environment:
5-
POSTGRES_PORT: tcp://localhost:5432
6-
POSTGRES_ENV_POSTGRES_USER: postgres
7-
POSTGRES_ENV_POSTGRES_PASSWORD: Password12!
8-
POSTGRES_ENV_POSTGRES_DB: JsonApiDotNetCoreExample
95
PGUSER: postgres
106
PGPASSWORD: Password12!
11-
Data:DefaultConnection: "Host=localhost;Port=5432;Database=JsonApiDotNetCoreExample;User ID=postgres;Password=Password12!"
127
ACCESS_TOKEN:
138
secure: g1T332Uarmdgtkftchpafa8tDP/7eM4O0BD6iu1wu+zR224IyH5R8pb4sTChr4Ia
149

@@ -63,10 +58,9 @@ init:
6358
- SET PATH=C:\Program Files\PostgreSQL\9.6\bin\;%PATH%
6459

6560
services:
66-
- postgresql
61+
- postgresql96
6762

6863
build_script:
69-
- ps: createdb JsonApiDotNetCoreExample
7064
- ps: dotnet --version
7165
- ps: .\Build.ps1
7266

src/Examples/GettingStarted/Controllers/ArticlesController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using JsonApiDotNetCore.Services;
55
using Microsoft.Extensions.Logging;
66

7-
namespace GettingStarted
7+
namespace GettingStarted.Controllers
88
{
99
public sealed class ArticlesController : JsonApiController<Article>
1010
{

src/Examples/GettingStarted/Controllers/PeopleController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using JsonApiDotNetCore.Services;
55
using Microsoft.Extensions.Logging;
66

7-
namespace GettingStarted
7+
namespace GettingStarted.Controllers
88
{
99
public sealed class PeopleController : JsonApiController<Person>
1010
{
Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
using GettingStarted.Models;
2-
using GettingStarted.ResourceDefinitionExample;
32
using Microsoft.EntityFrameworkCore;
43

5-
namespace GettingStarted
4+
namespace GettingStarted.Data
65
{
76
public class SampleDbContext : DbContext
87
{
9-
public SampleDbContext(DbContextOptions<SampleDbContext> options) : base(options) { }
108
public DbSet<Article> Articles { get; set; }
11-
public DbSet<Person> People { get; set; }
12-
public DbSet<Model> Models { get; set; }
9+
10+
public SampleDbContext(DbContextOptions<SampleDbContext> options)
11+
: base(options)
12+
{
13+
}
14+
15+
protected override void OnModelCreating(ModelBuilder modelBuilder)
16+
{
17+
modelBuilder.Entity<Person>();
18+
}
1319
}
14-
}
20+
}

src/Examples/GettingStarted/Models/Article.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ public sealed class Article : Identifiable
66
{
77
[Attr]
88
public string Title { get; set; }
9+
910
[HasOne]
1011
public Person Author { get; set; }
11-
public int AuthorId { get; set; }
1212
}
1313
}

src/Examples/GettingStarted/Models/Person.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ namespace GettingStarted.Models
55
{
66
public sealed class Person : Identifiable
77
{
8-
[Attr]
8+
[Attr]
99
public string Name { get; set; }
1010

11-
[HasMany]
11+
[HasMany]
1212
public ICollection<Article> Articles { get; set; }
1313
}
1414
}
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
using Microsoft.AspNetCore;
21
using Microsoft.AspNetCore.Hosting;
2+
using Microsoft.Extensions.Hosting;
33

44
namespace GettingStarted
55
{
66
public class Program
77
{
88
public static void Main(string[] args)
99
{
10-
CreateWebHostBuilder(args).Build().Run();
10+
CreateHostBuilder(args).Build().Run();
1111
}
1212

13-
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
14-
WebHost.CreateDefaultBuilder(args)
15-
.UseStartup<Startup>()
16-
.UseUrls("http://localhost:5001");
13+
public static IHostBuilder CreateHostBuilder(string[] args) =>
14+
Host.CreateDefaultBuilder(args)
15+
.ConfigureWebHostDefaults(webBuilder =>
16+
{
17+
webBuilder.UseStartup<Startup>();
18+
});
1719
}
1820
}
Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,30 @@
11
{
2-
"profiles": {
3-
"GettingStarted": {
4-
"commandName": "Project",
5-
"launchBrowser": true,
6-
"environmentVariables": {
7-
"ASPNETCORE_ENVIRONMENT": "Development"
8-
},
9-
"applicationUrl": "https://localhost:5001;http://localhost:5000"
2+
"$schema": "http://json.schemastore.org/launchsettings.json",
3+
"iisSettings": {
4+
"windowsAuthentication": false,
5+
"anonymousAuthentication": true,
6+
"iisExpress": {
7+
"applicationUrl": "http://localhost:14141",
8+
"sslPort": 44344
9+
}
10+
},
11+
"profiles": {
12+
"IIS Express": {
13+
"commandName": "IISExpress",
14+
"launchBrowser": false,
15+
"launchUrl": "api/people",
16+
"environmentVariables": {
17+
"ASPNETCORE_ENVIRONMENT": "Development"
18+
}
19+
},
20+
"Kestrel": {
21+
"commandName": "Project",
22+
"launchBrowser": false,
23+
"launchUrl": "api/people",
24+
"applicationUrl": "https://localhost:44344;http://localhost:14141",
25+
"environmentVariables": {
26+
"ASPNETCORE_ENVIRONMENT": "Development"
27+
}
28+
}
1029
}
11-
}
12-
}
30+
}

src/Examples/GettingStarted/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
`dotnet run` to run the project
66

77
You can verify the project is running by checking this endpoint:
8-
`localhost:5001/api/sample-model`
8+
`localhost:14141/api/people`
99

1010
For further documentation and implementation of a JsonApiDotnetCore Application see the documentation or GitHub page:
1111

1212
Repository: https://github.com/json-api-dotnet/JsonApiDotNetCore
1313

14-
Documentation: https://json-api-dotnet.github.io/
14+
Documentation: https://json-api-dotnet.github.io/

0 commit comments

Comments
 (0)