Skip to content

Commit 352108b

Browse files
Update all projects for final .NET Core RC2
1 parent d1964f0 commit 352108b

File tree

27 files changed

+280
-400
lines changed

27 files changed

+280
-400
lines changed

NuGet.Config

Lines changed: 0 additions & 7 deletions
This file was deleted.

samples/angular/MusicStore/Apis/AlbumsApiController.cs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ public async Task<ActionResult> Paged(int page = 1, int pageSize = 50, string so
2929
await _storeContext.Artists.LoadAsync();
3030

3131
var albums = await _storeContext.Albums
32-
// .Include(a => a.Genre)
33-
// .Include(a => a.Artist)
32+
.Include(a => a.Genre)
33+
.Include(a => a.Artist)
3434
.ToPagedListAsync(page, pageSize, sortBy,
3535
a => a.Title, // sortExpression
3636
SortDirection.Ascending, // defaultSortDirection
@@ -44,8 +44,8 @@ public async Task<ActionResult> Paged(int page = 1, int pageSize = 50, string so
4444
public async Task<ActionResult> All()
4545
{
4646
var albums = await _storeContext.Albums
47-
//.Include(a => a.Genre)
48-
//.Include(a => a.Artist)
47+
.Include(a => a.Genre)
48+
.Include(a => a.Artist)
4949
.OrderBy(a => a.Title)
5050
.ToListAsync();
5151

@@ -74,17 +74,13 @@ public async Task<ActionResult> Details(int albumId)
7474
await _storeContext.Artists.LoadAsync();
7575

7676
var album = await _storeContext.Albums
77-
//.Include(a => a.Artist)
78-
//.Include(a => a.Genre)
77+
.Include(a => a.Artist)
78+
.Include(a => a.Genre)
7979
.Where(a => a.AlbumId == albumId)
8080
.SingleOrDefaultAsync();
8181

8282
var albumResult = Mapper.Map(album, new AlbumResultDto());
8383

84-
// TODO: Get these from the related entities when EF supports that again, i.e. when .Include() works
85-
//album.Artist.Name = (await _storeContext.Artists.SingleOrDefaultAsync(a => a.ArtistId == album.ArtistId)).Name;
86-
//album.Genre.Name = (await _storeContext.Genres.SingleOrDefaultAsync(g => g.GenreId == album.GenreId)).Name;
87-
8884
// TODO: Add null checking and return 404 in that case
8985

9086
return Json(albumResult);
@@ -147,7 +143,6 @@ public async Task<ActionResult> UpdateAlbum(int albumId, [FromBody] AlbumChangeD
147143
public async Task<ActionResult> DeleteAlbum(int albumId)
148144
{
149145
var album = await _storeContext.Albums.SingleOrDefaultAsync(a => a.AlbumId == albumId);
150-
//var album = _storeContext.Albums.SingleOrDefault(a => a.AlbumId == albumId);
151146

152147
if (album != null)
153148
{

samples/angular/MusicStore/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public static void Main(string[] args)
8686
{
8787
var host = new WebHostBuilder()
8888
.UseContentRoot(Directory.GetCurrentDirectory())
89-
.UseIISPlatformHandlerUrl()
89+
.UseIISIntegration()
9090
.UseKestrel()
9191
.UseStartup<Startup>()
9292
.Build();
Lines changed: 24 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
{
22
"version": "1.0.0-*",
3-
"compilationOptions": {
3+
"buildOptions": {
44
"emitEntryPoint": true,
5-
"warningsAsErrors": true,
65
"preserveCompilationContext": true
76
},
7+
"runtimeOptions": {
8+
"gcServer": true
9+
},
810
"tooling": {
911
"defaultNamespace": "MusicStore"
1012
},
1113

12-
"dependencies": {
14+
"dependencies": {
15+
"Microsoft.NETCore.App": {
16+
"version": "1.0.0-rc2-*",
17+
"type": "platform"
18+
},
1319
"Microsoft.AspNetCore.Diagnostics": "1.0.0-*",
1420
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0-*",
15-
"Microsoft.AspNetCore.IISPlatformHandler": "1.0.0-*",
21+
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-*",
1622
"Microsoft.AspNetCore.Mvc": "1.0.0-*",
1723
"Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0-*",
1824
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*",
@@ -25,39 +31,26 @@
2531
"Microsoft.AspNetCore.AngularServices": "1.0.0-*",
2632
"AutoMapper": "4.1.1"
2733
},
28-
"commands": {
29-
"web": "Microsoft.AspNetCore.Server.Kestrel"
30-
},
3134
"frameworks": {
3235
"netcoreapp1.0": {
3336
"imports": [
37+
"dotnet5.6",
3438
"dnxcore50",
35-
"portable-net451+win8"
36-
],
37-
"dependencies": {
38-
"Microsoft.NETCore.App": {
39-
"version": "1.0.0-*",
40-
"type": "platform"
41-
}
42-
}
39+
"portable-net45+win8"
40+
]
4341
}
4442
},
45-
"exclude": [
46-
"wwwroot",
47-
"node_modules",
48-
"bower_components"
49-
],
50-
"publishExclude": [
51-
"node_modules",
52-
"bower_components",
53-
"**.xproj",
54-
"**.user",
55-
"**.vspscc"
56-
],
57-
"scripts": {
58-
"prepublish": [
59-
"npm install",
60-
"gulp"
43+
"publishOptions": {
44+
"exclude": [
45+
"node_modules",
46+
"bower_components",
47+
"**.xproj",
48+
"**.user",
49+
"**.vspscc"
6150
]
51+
},
52+
"scripts": {
53+
"prepublish": [ "npm install" ],
54+
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
6255
}
6356
}

samples/misc/ES2015Transpilation/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public static void Main(string[] args)
5454
{
5555
var host = new WebHostBuilder()
5656
.UseContentRoot(Directory.GetCurrentDirectory())
57-
.UseIISPlatformHandlerUrl()
57+
.UseIISIntegration()
5858
.UseKestrel()
5959
.UseStartup<Startup>()
6060
.Build();
Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
{
2-
"webroot": "wwwroot",
32
"version": "1.0.0-*",
43
"tooling": {
54
"defaultNamespace": "ES2015Example"
65
},
7-
"compilationOptions": {
6+
"buildOptions": {
87
"emitEntryPoint": true,
9-
"warningsAsErrors": true,
108
"preserveCompilationContext": true
119
},
10+
"runtimeOptions": {
11+
"gcServer": true
12+
},
1213
"dependencies": {
14+
"Microsoft.NETCore.App": {
15+
"version": "1.0.0-rc2-3002702",
16+
"type": "platform"
17+
},
1318
"Microsoft.AspNetCore.Diagnostics": "1.0.0-*",
14-
"Microsoft.AspNetCore.IISPlatformHandler": "1.0.0-*",
19+
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-*",
1520
"Microsoft.AspNetCore.Mvc": "1.0.0-*",
1621
"Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0-*",
1722
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*",
@@ -25,22 +30,12 @@
2530
"frameworks": {
2631
"netcoreapp1.0": {
2732
"imports": [
33+
"dotnet5.6",
2834
"dnxcore50",
29-
"portable-net451+win8"
30-
],
31-
"dependencies": {
32-
"Microsoft.NETCore.App": {
33-
"version": "1.0.0-*",
34-
"type": "platform"
35-
}
36-
}
35+
"portable-net45+win8"
36+
]
3737
}
3838
},
39-
"exclude": [
40-
"wwwroot",
41-
"node_modules",
42-
"bower_components"
43-
],
4439
"publishExclude": [
4540
"node_modules",
4641
"bower_components",
@@ -49,8 +44,7 @@
4944
"**.vspscc"
5045
],
5146
"scripts": {
52-
"prepublish": [
53-
"npm install"
54-
]
47+
"prepublish": [ "npm install" ],
48+
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
5549
}
5650
}

samples/misc/Webpack/Startup.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory, IHo
2121
{
2222
app.UseDeveloperExceptionPage();
2323

24-
if (env.IsDevelopment()) {
25-
app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions {
26-
HotModuleReplacement = true
27-
});
28-
}
24+
// For real apps, you should only use Webpack Dev Middleware at development time. For production,
25+
// you'll get better performance and reliability if you precompile the webpack output and simply
26+
// serve the resulting static files. For examples of setting up this automatic switch between
27+
// development-style and production-style webpack usage, see the 'templates' dir in this repo.
28+
app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions {
29+
HotModuleReplacement = true
30+
});
2931

3032
app.UseStaticFiles();
3133
loggerFactory.AddConsole();
@@ -41,7 +43,7 @@ public static void Main(string[] args)
4143
{
4244
var host = new WebHostBuilder()
4345
.UseContentRoot(Directory.GetCurrentDirectory())
44-
.UseIISPlatformHandlerUrl()
46+
.UseIISIntegration()
4547
.UseKestrel()
4648
.UseStartup<Startup>()
4749
.Build();

samples/misc/Webpack/project.json

Lines changed: 23 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
{
22
"version": "1.0.0-*",
3-
"compilationOptions": {
3+
"buildOptions": {
44
"emitEntryPoint": true,
5-
"warningsAsErrors": true,
65
"preserveCompilationContext": true
76
},
7+
"runtimeOptions": {
8+
"gcServer": true
9+
},
810
"tooling": {
911
"defaultNamespace": "Webpack"
1012
},
11-
1213
"dependencies": {
14+
"Microsoft.NETCore.App": {
15+
"version": "1.0.0-rc2-3002702",
16+
"type": "platform"
17+
},
1318
"Microsoft.AspNetCore.Diagnostics": "1.0.0-*",
14-
"Microsoft.AspNetCore.IISPlatformHandler": "1.0.0-*",
19+
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-*",
1520
"Microsoft.AspNetCore.Mvc": "1.0.0-*",
1621
"Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0-*",
1722
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*",
@@ -22,41 +27,26 @@
2227
"Microsoft.Extensions.Logging.Debug": "1.0.0-*",
2328
"Microsoft.AspNetCore.SpaServices": "1.0.0-*"
2429
},
25-
26-
"commands": {
27-
"web": "Microsoft.AspNetCore.Server.Kestrel"
28-
},
29-
3030
"frameworks": {
3131
"netcoreapp1.0": {
3232
"imports": [
33+
"dotnet5.6",
3334
"dnxcore50",
34-
"portable-net451+win8"
35-
],
36-
"dependencies": {
37-
"Microsoft.NETCore.App": {
38-
"version": "1.0.0-*",
39-
"type": "platform"
40-
}
41-
}
35+
"portable-net45+win8"
36+
]
4237
}
4338
},
44-
45-
"exclude": [
46-
"wwwroot",
47-
"node_modules",
48-
"bower_components"
49-
],
50-
"publishExclude": [
51-
"node_modules",
52-
"bower_components",
53-
"**.xproj",
54-
"**.user",
55-
"**.vspscc"
56-
],
57-
"scripts": {
58-
"prepublish": [
59-
"npm install"
39+
"publishOptions": {
40+
"exclude": [
41+
"node_modules",
42+
"bower_components",
43+
"**.xproj",
44+
"**.user",
45+
"**.vspscc"
6046
]
47+
},
48+
"scripts": {
49+
"prepublish": [ "npm install" ],
50+
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
6151
}
6252
}

samples/react/MusicStore/Apis/AlbumsApiController.cs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ public async Task<ActionResult> Paged(int page = 1, int pageSize = 50, string so
2929
await _storeContext.Artists.LoadAsync();
3030

3131
var albums = await _storeContext.Albums
32-
// .Include(a => a.Genre)
33-
// .Include(a => a.Artist)
32+
.Include(a => a.Genre)
33+
.Include(a => a.Artist)
3434
.ToPagedListAsync(page, pageSize, sortBy,
3535
a => a.Title, // sortExpression
3636
SortDirection.Ascending, // defaultSortDirection
@@ -44,8 +44,8 @@ public async Task<ActionResult> Paged(int page = 1, int pageSize = 50, string so
4444
public async Task<ActionResult> All()
4545
{
4646
var albums = await _storeContext.Albums
47-
//.Include(a => a.Genre)
48-
//.Include(a => a.Artist)
47+
.Include(a => a.Genre)
48+
.Include(a => a.Artist)
4949
.OrderBy(a => a.Title)
5050
.ToListAsync();
5151

@@ -74,17 +74,13 @@ public async Task<ActionResult> Details(int albumId)
7474
await _storeContext.Artists.LoadAsync();
7575

7676
var album = await _storeContext.Albums
77-
//.Include(a => a.Artist)
78-
//.Include(a => a.Genre)
77+
.Include(a => a.Artist)
78+
.Include(a => a.Genre)
7979
.Where(a => a.AlbumId == albumId)
8080
.SingleOrDefaultAsync();
8181

8282
var albumResult = Mapper.Map(album, new AlbumResultDto());
8383

84-
// TODO: Get these from the related entities when EF supports that again, i.e. when .Include() works
85-
//album.Artist.Name = (await _storeContext.Artists.SingleOrDefaultAsync(a => a.ArtistId == album.ArtistId)).Name;
86-
//album.Genre.Name = (await _storeContext.Genres.SingleOrDefaultAsync(g => g.GenreId == album.GenreId)).Name;
87-
8884
// TODO: Add null checking and return 404 in that case
8985

9086
return Json(albumResult);
@@ -147,7 +143,6 @@ public async Task<ActionResult> UpdateAlbum(int albumId, [FromBody] AlbumChangeD
147143
public async Task<ActionResult> DeleteAlbum(int albumId)
148144
{
149145
var album = await _storeContext.Albums.SingleOrDefaultAsync(a => a.AlbumId == albumId);
150-
//var album = _storeContext.Albums.SingleOrDefault(a => a.AlbumId == albumId);
151146

152147
if (album != null)
153148
{

samples/react/MusicStore/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public static void Main(string[] args)
9696
{
9797
var host = new WebHostBuilder()
9898
.UseContentRoot(Directory.GetCurrentDirectory())
99-
.UseIISPlatformHandlerUrl()
99+
.UseIISIntegration()
100100
.UseKestrel()
101101
.UseStartup<Startup>()
102102
.Build();

0 commit comments

Comments
 (0)