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
using System.Collections.Generic;
33
using System.Linq;
44
using System.Threading.Tasks;
5-
using Microsoft.AspNet.Authorization;
6-
using Microsoft.AspNet.Mvc;
7-
using Microsoft.Data.Entity;
5+
using Microsoft.AspNetCore.Authorization;
6+
using Microsoft.AspNetCore.Mvc;
7+
using Microsoft.EntityFrameworkCore;
88
using AutoMapper;
99
using MusicStore.Models;
1010
using MusicStore.Infrastructure;
@@ -97,7 +97,7 @@ public async Task<ActionResult> CreateAlbum([FromBody]AlbumChangeDto album)
9797
if (!ModelState.IsValid)
9898
{
9999
// Return the model errors
100-
return HttpBadRequest(ModelState);
100+
return BadRequest(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-
return HttpBadRequest(ModelState);
122+
return BadRequest(ModelState);
123123
}
124124

125125
var dbAlbum = 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
using System;
22
using System.Linq;
33
using System.Threading.Tasks;
4-
using Microsoft.AspNet.Mvc;
5-
using Microsoft.Data.Entity;
4+
using Microsoft.AspNetCore.Mvc;
5+
using Microsoft.EntityFrameworkCore;
66
using MusicStore.Models;
77

88
namespace MusicStore.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
using System.Linq;
22
using System.Threading.Tasks;
3-
using Microsoft.AspNet.Mvc;
4-
using Microsoft.Data.Entity;
3+
using Microsoft.AspNetCore.Mvc;
4+
using Microsoft.EntityFrameworkCore;
55
using MusicStore.Models;
66
using MusicStore.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-
using Microsoft.AspNet.Identity.EntityFramework;
2-
using Microsoft.Data.Entity;
1+
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
2+
using Microsoft.EntityFrameworkCore;
33

44
namespace MusicStore.Models
55
{
66
public class ApplicationUser : IdentityUser { }
77

88
public class MusicStoreContext : IdentityDbContext<ApplicationUser>
99
{
10-
public MusicStoreContext()
10+
public MusicStoreContext(DbContextOptions options) : 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
using System.Linq;
44
using System.Security.Claims;
55
using System.Threading.Tasks;
6-
using Microsoft.AspNet.Identity;
7-
using Microsoft.AspNet.Identity.EntityFramework;
8-
using Microsoft.Data.Entity;
6+
using Microsoft.AspNetCore.Identity;
7+
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
8+
using Microsoft.EntityFrameworkCore;
99
using Microsoft.Extensions.DependencyInjection;
10-
using Microsoft.Extensions.OptionsModel;
10+
using Microsoft.Extensions.Options;
1111

1212
namespace MusicStore.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-
using Microsoft.AspNet.Http;
2-
using Microsoft.Data.Entity;
1+
using Microsoft.AspNetCore.Http;
2+
using Microsoft.EntityFrameworkCore;
33
using System;
44
using System.Collections.Generic;
55
using System.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-
using Microsoft.AspNet.Mvc;
1+
using Microsoft.AspNetCore.Mvc;
22

33
namespace MusicStore.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-
using Microsoft.AspNet.Mvc;
1+
using Microsoft.AspNetCore.Mvc;
22
using System;
3-
using Microsoft.AspNet.Mvc.Filters;
3+
using Microsoft.AspNetCore.Mvc.Filters;
44

55
namespace MusicStore.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-
using Microsoft.Data.Entity;
1+
using Microsoft.EntityFrameworkCore;
22
using System;
33
using System.Collections.Generic;
44
using System.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
using System.Linq;
44
using System.Linq.Expressions;
55
using System.Threading.Tasks;
6-
using Microsoft.AspNet.Mvc.ViewFeatures;
6+
using Microsoft.AspNetCore.Mvc.ViewFeatures.Internal;
77

88
namespace MusicStore.Infrastructure
99
{

0 commit comments

Comments
 (0)