mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
Add strong naming and fix DB path on IIS Express
This commit is contained in:
5
samples/angular/MusicStore/.gitignore
vendored
5
samples/angular/MusicStore/.gitignore
vendored
@@ -3,3 +3,8 @@
|
|||||||
/wwwroot/ng-app/**/*.js
|
/wwwroot/ng-app/**/*.js
|
||||||
/project.lock.json
|
/project.lock.json
|
||||||
/music-db.sqlite
|
/music-db.sqlite
|
||||||
|
/Properties/launchSettings.json
|
||||||
|
|
||||||
|
# Obviously you don't really want your DB to go in wwwroot, but due to https://github.com/aspnet/Microsoft.Data.Sqlite/issues/188
|
||||||
|
# it currently does when run from IIS Express. Will resolve this once RC2 is out, which is supposed to eliminate the inconsistency.
|
||||||
|
/wwwroot/music-db.sqlite
|
||||||
|
|||||||
@@ -22,36 +22,10 @@ namespace MusicStore.Models
|
|||||||
if (await db.Database.EnsureCreatedAsync())
|
if (await db.Database.EnsureCreatedAsync())
|
||||||
{
|
{
|
||||||
await InsertTestData(serviceProvider);
|
await InsertTestData(serviceProvider);
|
||||||
await CreateAdminUser(serviceProvider);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async Task CreateAdminUser(IServiceProvider serviceProvider)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
|
|
||||||
var settings = serviceProvider.GetService<IOptions<SiteSettings>>().Value;
|
|
||||||
const string adminRole = "Administrator";
|
|
||||||
|
|
||||||
var userManager = serviceProvider.GetService<UserManager<ApplicationUser>>();
|
|
||||||
var roleManager = serviceProvider.GetService<RoleManager<IdentityRole>>();
|
|
||||||
|
|
||||||
if (!await roleManager.RoleExistsAsync(adminRole))
|
|
||||||
{
|
|
||||||
await roleManager.CreateAsync(new IdentityRole(adminRole));
|
|
||||||
}
|
|
||||||
|
|
||||||
var user = await userManager.FindByNameAsync(settings.DefaultAdminUsername);
|
|
||||||
if (user == null)
|
|
||||||
{
|
|
||||||
user = new ApplicationUser { UserName = settings.DefaultAdminUsername };
|
|
||||||
await userManager.CreateAsync(user, settings.DefaultAdminPassword);
|
|
||||||
await userManager.AddToRoleAsync(user, adminRole);
|
|
||||||
await userManager.AddClaimAsync(user, new Claim("app-ManageStore", "Allowed"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static async Task InsertTestData(IServiceProvider serviceProvider)
|
private static async Task InsertTestData(IServiceProvider serviceProvider)
|
||||||
{
|
{
|
||||||
var albums = GetAlbums(imgUrl, Genres, Artists);
|
var albums = GetAlbums(imgUrl, Genres, Artists);
|
||||||
|
|||||||
1
samples/misc/ES2015Transpilation/.gitignore
vendored
1
samples/misc/ES2015Transpilation/.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
/node_modules/
|
/node_modules/
|
||||||
|
/Properties/launchSettings.json
|
||||||
|
|||||||
1
samples/react/ReactGrid/.gitignore
vendored
1
samples/react/ReactGrid/.gitignore
vendored
@@ -3,3 +3,4 @@ project.lock.json
|
|||||||
/wwwroot/bundle.*
|
/wwwroot/bundle.*
|
||||||
/wwwroot/*.svg
|
/wwwroot/*.svg
|
||||||
/wwwroot/*.css
|
/wwwroot/*.css
|
||||||
|
/Properties/launchSettings.json
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ namespace ReactExample.Controllers
|
|||||||
public class PeopleApiController : Controller
|
public class PeopleApiController : Controller
|
||||||
{
|
{
|
||||||
[HttpPut("api/people/{personId:int}")]
|
[HttpPut("api/people/{personId:int}")]
|
||||||
public async Task<ActionResult> UpdatePerson([FromBody] PersonDto person)
|
public ActionResult UpdatePerson([FromBody] PersonDto person)
|
||||||
{
|
{
|
||||||
if (!ModelState.IsValid) {
|
if (!ModelState.IsValid) {
|
||||||
return HttpBadRequest(ModelState);
|
return HttpBadRequest(ModelState);
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
{
|
{
|
||||||
"version": "1.0.0-alpha7",
|
"version": "1.0.0-alpha7",
|
||||||
"description": "Helpers for building Angular 2 applications on ASP.NET 5.",
|
"description": "Helpers for building Angular 2 applications on ASP.NET 5.",
|
||||||
|
"compilationOptions": {
|
||||||
|
"keyFile": "../../tools/Key.snk"
|
||||||
|
},
|
||||||
"authors": [ "Microsoft" ],
|
"authors": [ "Microsoft" ],
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
{
|
{
|
||||||
"version": "1.0.0-alpha7",
|
"version": "1.0.0-alpha7",
|
||||||
"description": "Invoke Node.js modules at runtime in ASP.NET 5 applications.",
|
"description": "Invoke Node.js modules at runtime in ASP.NET 5 applications.",
|
||||||
|
"compilationOptions": {
|
||||||
|
"keyFile": "../../tools/Key.snk"
|
||||||
|
},
|
||||||
"authors": [ "Microsoft" ],
|
"authors": [ "Microsoft" ],
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
{
|
{
|
||||||
"version": "1.0.0-alpha7",
|
"version": "1.0.0-alpha7",
|
||||||
"description": "Helpers for building React applications on ASP.NET 5.",
|
"description": "Helpers for building React applications on ASP.NET 5.",
|
||||||
|
"compilationOptions": {
|
||||||
|
"keyFile": "../../tools/Key.snk"
|
||||||
|
},
|
||||||
"authors": [ "Microsoft" ],
|
"authors": [ "Microsoft" ],
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
{
|
{
|
||||||
"version": "1.0.0-alpha7-1",
|
"version": "1.0.0-alpha7-1",
|
||||||
"description": "Microsoft.AspNet.SpaServices",
|
"description": "Microsoft.AspNet.SpaServices",
|
||||||
|
"compilationOptions": {
|
||||||
|
"keyFile": "../../tools/Key.snk"
|
||||||
|
},
|
||||||
"authors": [
|
"authors": [
|
||||||
"Microsoft"
|
"Microsoft"
|
||||||
],
|
],
|
||||||
|
|||||||
BIN
tools/Key.snk
Normal file
BIN
tools/Key.snk
Normal file
Binary file not shown.
Reference in New Issue
Block a user