X Tutup
Skip to content

Commit 73e218d

Browse files
Add strong naming and fix DB path on IIS Express
1 parent 2218212 commit 73e218d

File tree

10 files changed

+20
-27
lines changed

10 files changed

+20
-27
lines changed

samples/angular/MusicStore/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,8 @@
33
/wwwroot/ng-app/**/*.js
44
/project.lock.json
55
/music-db.sqlite
6+
/Properties/launchSettings.json
7+
8+
# Obviously you don't really want your DB to go in wwwroot, but due to https://github.com/aspnet/Microsoft.Data.Sqlite/issues/188
9+
# it currently does when run from IIS Express. Will resolve this once RC2 is out, which is supposed to eliminate the inconsistency.
10+
/wwwroot/music-db.sqlite

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

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,36 +22,10 @@ public static async Task InitializeMusicStoreDatabaseAsync(IServiceProvider serv
2222
if (await db.Database.EnsureCreatedAsync())
2323
{
2424
await InsertTestData(serviceProvider);
25-
await CreateAdminUser(serviceProvider);
2625
}
2726
}
2827
}
2928

30-
private static async Task CreateAdminUser(IServiceProvider serviceProvider)
31-
{
32-
return;
33-
34-
var settings = serviceProvider.GetService<IOptions<SiteSettings>>().Value;
35-
const string adminRole = "Administrator";
36-
37-
var userManager = serviceProvider.GetService<UserManager<ApplicationUser>>();
38-
var roleManager = serviceProvider.GetService<RoleManager<IdentityRole>>();
39-
40-
if (!await roleManager.RoleExistsAsync(adminRole))
41-
{
42-
await roleManager.CreateAsync(new IdentityRole(adminRole));
43-
}
44-
45-
var user = await userManager.FindByNameAsync(settings.DefaultAdminUsername);
46-
if (user == null)
47-
{
48-
user = new ApplicationUser { UserName = settings.DefaultAdminUsername };
49-
await userManager.CreateAsync(user, settings.DefaultAdminPassword);
50-
await userManager.AddToRoleAsync(user, adminRole);
51-
await userManager.AddClaimAsync(user, new Claim("app-ManageStore", "Allowed"));
52-
}
53-
}
54-
5529
private static async Task InsertTestData(IServiceProvider serviceProvider)
5630
{
5731
var albums = GetAlbums(imgUrl, Genres, Artists);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/node_modules/
2+
/Properties/launchSettings.json

samples/react/ReactGrid/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ project.lock.json
33
/wwwroot/bundle.*
44
/wwwroot/*.svg
55
/wwwroot/*.css
6+
/Properties/launchSettings.json

samples/react/ReactGrid/Controllers/PeopleApiController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace ReactExample.Controllers
77
public class PeopleApiController : Controller
88
{
99
[HttpPut("api/people/{personId:int}")]
10-
public async Task<ActionResult> UpdatePerson([FromBody] PersonDto person)
10+
public ActionResult UpdatePerson([FromBody] PersonDto person)
1111
{
1212
if (!ModelState.IsValid) {
1313
return HttpBadRequest(ModelState);

src/Microsoft.AspNet.AngularServices/project.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"version": "1.0.0-alpha7",
33
"description": "Helpers for building Angular 2 applications on ASP.NET 5.",
4+
"compilationOptions": {
5+
"keyFile": "../../tools/Key.snk"
6+
},
47
"authors": [ "Microsoft" ],
58
"repository": {
69
"type": "git",

src/Microsoft.AspNet.NodeServices/project.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"version": "1.0.0-alpha7",
33
"description": "Invoke Node.js modules at runtime in ASP.NET 5 applications.",
4+
"compilationOptions": {
5+
"keyFile": "../../tools/Key.snk"
6+
},
47
"authors": [ "Microsoft" ],
58
"repository": {
69
"type": "git",

src/Microsoft.AspNet.ReactServices/project.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"version": "1.0.0-alpha7",
33
"description": "Helpers for building React applications on ASP.NET 5.",
4+
"compilationOptions": {
5+
"keyFile": "../../tools/Key.snk"
6+
},
47
"authors": [ "Microsoft" ],
58
"repository": {
69
"type": "git",

src/Microsoft.AspNet.SpaServices/project.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"version": "1.0.0-alpha7-1",
33
"description": "Microsoft.AspNet.SpaServices",
4+
"compilationOptions": {
5+
"keyFile": "../../tools/Key.snk"
6+
},
47
"authors": [
58
"Microsoft"
69
],

tools/Key.snk

596 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)
X Tutup