Skip to content

Commit 507c432

Browse files
Incomplete work on migrating Angular 2 Music Store sample to ASP.NET Core 1.0 RC2
1 parent 1cb4dd9 commit 507c432

File tree

15 files changed

+85
-116
lines changed

15 files changed

+85
-116
lines changed

‎samples/angular/MusicStore/Apis/AlbumsApiController.cs‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
usingSystem.Collections.Generic;
33
usingSystem.Linq;
44
usingSystem.Threading.Tasks;
5-
usingMicrosoft.AspNet.Authorization;
6-
usingMicrosoft.AspNet.Mvc;
7-
usingMicrosoft.Data.Entity;
5+
usingMicrosoft.AspNetCore.Authorization;
6+
usingMicrosoft.AspNetCore.Mvc;
7+
usingMicrosoft.EntityFrameworkCore;
88
usingAutoMapper;
99
usingMusicStore.Models;
1010
usingMusicStore.Infrastructure;
@@ -97,7 +97,7 @@ public async Task<ActionResult> CreateAlbum([FromBody]AlbumChangeDto album)
9797
if(!ModelState.IsValid)
9898
{
9999
// Return the model errors
100-
returnHttpBadRequest(ModelState);
100+
returnBadRequest(ModelState);
101101
}
102102

103103
// Save the changes to the DB
@@ -119,7 +119,7 @@ public async Task<ActionResult> UpdateAlbum(int albumId, [FromBody] AlbumChangeD
119119
if(!ModelState.IsValid)
120120
{
121121
// Return the model errors
122-
returnHttpBadRequest(ModelState);
122+
returnBadRequest(ModelState);
123123
}
124124

125125
vardbAlbum=await_storeContext.Albums.SingleOrDefaultAsync(a =>a.AlbumId==albumId);

‎samples/angular/MusicStore/Apis/ArtistsApiController.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
usingSystem;
22
usingSystem.Linq;
33
usingSystem.Threading.Tasks;
4-
usingMicrosoft.AspNet.Mvc;
5-
usingMicrosoft.Data.Entity;
4+
usingMicrosoft.AspNetCore.Mvc;
5+
usingMicrosoft.EntityFrameworkCore;
66
usingMusicStore.Models;
77

88
namespaceMusicStore.Apis

‎samples/angular/MusicStore/Apis/GenresApiController.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
usingSystem.Linq;
22
usingSystem.Threading.Tasks;
3-
usingMicrosoft.AspNet.Mvc;
4-
usingMicrosoft.Data.Entity;
3+
usingMicrosoft.AspNetCore.Mvc;
4+
usingMicrosoft.EntityFrameworkCore;
55
usingMusicStore.Models;
66
usingMusicStore.Infrastructure;
77

‎samples/angular/MusicStore/Apis/Models/MusicStoreContext.cs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
usingMicrosoft.AspNet.Identity.EntityFramework;
2-
usingMicrosoft.Data.Entity;
1+
usingMicrosoft.AspNetCore.Identity.EntityFrameworkCore;
2+
usingMicrosoft.EntityFrameworkCore;
33

44
namespaceMusicStore.Models
55
{
66
publicclassApplicationUser:IdentityUser{}
77

88
publicclassMusicStoreContext:IdentityDbContext<ApplicationUser>
99
{
10-
publicMusicStoreContext()
10+
publicMusicStoreContext(DbContextOptionsoptions):base(options)
1111
{
1212
}
1313

‎samples/angular/MusicStore/Apis/Models/SampleData.cs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
usingSystem.Linq;
44
usingSystem.Security.Claims;
55
usingSystem.Threading.Tasks;
6-
usingMicrosoft.AspNet.Identity;
7-
usingMicrosoft.AspNet.Identity.EntityFramework;
8-
usingMicrosoft.Data.Entity;
6+
usingMicrosoft.AspNetCore.Identity;
7+
usingMicrosoft.AspNetCore.Identity.EntityFrameworkCore;
8+
usingMicrosoft.EntityFrameworkCore;
99
usingMicrosoft.Extensions.DependencyInjection;
10-
usingMicrosoft.Extensions.OptionsModel;
10+
usingMicrosoft.Extensions.Options;
1111

1212
namespaceMusicStore.Models
1313
{

‎samples/angular/MusicStore/Apis/Models/ShoppingCart.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
usingMicrosoft.AspNet.Http;
2-
usingMicrosoft.Data.Entity;
1+
usingMicrosoft.AspNetCore.Http;
2+
usingMicrosoft.EntityFrameworkCore;
33
usingSystem;
44
usingSystem.Collections.Generic;
55
usingSystem.Linq;

‎samples/angular/MusicStore/Controllers/HomeController.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
usingMicrosoft.AspNet.Mvc;
1+
usingMicrosoft.AspNetCore.Mvc;
22

33
namespaceMusicStore.Controllers
44
{

‎samples/angular/MusicStore/Infrastructure/NoCacheAttribute.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
usingMicrosoft.AspNet.Mvc;
1+
usingMicrosoft.AspNetCore.Mvc;
22
usingSystem;
3-
usingMicrosoft.AspNet.Mvc.Filters;
3+
usingMicrosoft.AspNetCore.Mvc.Filters;
44

55
namespaceMusicStore.Infrastructure
66
{

‎samples/angular/MusicStore/Infrastructure/PagedList.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
usingMicrosoft.Data.Entity;
1+
usingMicrosoft.EntityFrameworkCore;
22
usingSystem;
33
usingSystem.Collections.Generic;
44
usingSystem.Linq;

‎samples/angular/MusicStore/Infrastructure/SortExpression.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
usingSystem.Linq;
44
usingSystem.Linq.Expressions;
55
usingSystem.Threading.Tasks;
6-
usingMicrosoft.AspNet.Mvc.ViewFeatures;
6+
usingMicrosoft.AspNetCore.Mvc.ViewFeatures.Internal;
77

88
namespaceMusicStore.Infrastructure
99
{

0 commit comments

Comments
(0)