Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

Commit

Permalink
⬆️ Update web application template to aspnet. Closes #694
Browse files Browse the repository at this point in the history
This commit brings latest changes from aspnet/Templates
See: #694
  • Loading branch information
peterblazejewicz committed May 12, 2016
1 parent 3b28476 commit 4b7cddc
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 68 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;

namespace <%= namespace %>.Data.Migrations
Expand Down Expand Up @@ -69,7 +66,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
.Annotation("Autoincrement", true),
ClaimType = table.Column<string>(nullable: true),
ClaimValue = table.Column<string>(nullable: true),
RoleId = table.Column<string>(nullable: false)
Expand All @@ -90,7 +87,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
.Annotation("Autoincrement", true),
ClaimType = table.Column<string>(nullable: true),
ClaimValue = table.Column<string>(nullable: true),
UserId = table.Column<string>(nullable: false)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using <%= namespace %>.Data;

namespace <%= namespace %>.Data.Migrations
{
Expand All @@ -14,8 +13,7 @@ partial class ApplicationDbContextModelSnapshot : ModelSnapshot
protected override void BuildModel(ModelBuilder modelBuilder)
{
modelBuilder
.HasAnnotation("ProductVersion", "1.0.0-rc2")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
.HasAnnotation("ProductVersion", "1.0.0-rc2-20801");

modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole", b =>
{
Expand Down
15 changes: 15 additions & 0 deletions templates/projects/web/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:24189/",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"<%= namespace %>": {
"commandName": "Project",
"launchBrowser": true,
Expand Down
9 changes: 2 additions & 7 deletions templates/projects/web/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@ public Startup(IHostingEnvironment env)
{
var builder = new ConfigurationBuilder()
.SetBasePath(env.ContentRootPath)
.AddJsonFile(source =>
{
source.Path = "appsettings.json";
source.ReloadOnChange = true;
})
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true);

if (env.IsDevelopment())
Expand All @@ -36,7 +32,6 @@ public Startup(IHostingEnvironment env)

builder.AddEnvironmentVariables();
Configuration = builder.Build();
Configuration["ConnectionStrings:SQLite"] = $"Data Source={env.ContentRootPath}/<%= namespace %>.db";
}

public IConfigurationRoot Configuration { get; }
Expand All @@ -46,7 +41,7 @@ public void ConfigureServices(IServiceCollection services)
{
// Add framework services.
services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlite(Configuration.GetConnectionString("SQLite")));
options.UseSqlite(Configuration.GetConnectionString("DefaultConnection")));

services.AddIdentity<ApplicationUser, IdentityRole>()
.AddEntityFrameworkStores<ApplicationDbContext>()
Expand Down
3 changes: 3 additions & 0 deletions templates/projects/web/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ConnectionStrings": {
"DefaultConnection": "Data Source=WebApp_Auth.db"
},
"Logging": {
"IncludeScopes": false,
"LogLevel": {
Expand Down
92 changes: 46 additions & 46 deletions templates/projects/web/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,64 +3,68 @@

"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0-rc2-24008",
"version": "1.0.0-rc2-3002611",
"type": "platform"
},
"dotnet-aspnet-codegenerator": {
"version": "1.0.0-rc2-20581",
"Microsoft.AspNetCore.Authentication.Cookies": "1.0.0-rc2-20801",
"Microsoft.AspNetCore.Diagnostics": "1.0.0-rc2-20801",
"Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0-rc2-20801",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0-rc2-20801",
"Microsoft.AspNetCore.Mvc": "1.0.0-rc2-20801",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-rc2-20801",
"type": "build"
},
"dotnet-ef": {
"version": "1.0.0-rc2-20581",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-20801",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-20801",
"Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-20801",
"Microsoft.EntityFrameworkCore.Sqlite": "1.0.0-rc2-20801",
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.0.0-rc2-20801",
"type": "build"
},
"dotnet-razor-tooling": {
"version": "1.0.0-rc2-20581",
"Microsoft.Extensions.CodeGeneration.Tools": {
"version": "1.0.0-rc2-20801",
"type": "build"
},
"Microsoft.AspNetCore.Authentication.Cookies": "1.0.0-rc2-20581",
"Microsoft.AspNetCore.Diagnostics": "1.0.0-rc2-20581",
"Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0-rc2-20581",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0-rc2-20581",
"Microsoft.AspNetCore.Mvc": "1.0.0-rc2-20581",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-20581",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-20581",
"Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-20581",
"Microsoft.EntityFrameworkCore.Commands": "1.0.0-rc2-20581",
"Microsoft.EntityFrameworkCore.Sqlite": "1.0.0-rc2-20581",
"Microsoft.EntityFrameworkCore.SqlServer": "1.0.0-rc2-20581",
"Microsoft.Extensions.CodeGenerators.Mvc": "1.0.0-rc2-20581",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-20581",
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-20581",
"Microsoft.Extensions.Configuration.UserSecrets": "1.0.0-rc2-20581",
"Microsoft.Extensions.Logging": "1.0.0-rc2-20581",
"Microsoft.Extensions.Logging.Console": "1.0.0-rc2-20581",
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-20581",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc2-20581"
"Microsoft.Extensions.CodeGenerators.Mvc": {
"version": "1.0.0-rc2-20801",
"type": "build"
},
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-20801",
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-20801",
"Microsoft.Extensions.Configuration.UserSecrets": "1.0.0-rc2-20801",
"Microsoft.Extensions.Logging": "1.0.0-rc2-20801",
"Microsoft.Extensions.Logging.Console": "1.0.0-rc2-20801",
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-20801",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc2-20801"
},

"tools": {
"dotnet-aspnet-codegenerator": {
"version": "1.0.0-rc2-20581",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-rc2-20801",
"imports": "portable-net45+win8+dnxcore50"
},
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
"version": "1.0.0-rc2-20801",
"imports": "portable-net45+win8+dnxcore50"
},
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.0.0-rc2-20801",
"imports": [
"portable-net45+win8+dnxcore50",
"portable-net45+win8"
]
},
"dotnet-ef": {
"version": "1.0.0-rc2-20581",
"imports": "portable-net45+win8+dnxcore50"
},
"dotnet-razor-tooling": {
"version": "1.0.0-rc2-20581",
"imports": "portable-net45+win8+dnxcore50"
},
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
"version": "1.0.0-rc2-20581",
"imports": "portable-net45+win8+dnxcore50"
"Microsoft.Extensions.CodeGeneration.Tools": {
"version": "1.0.0-rc2-20801",
"imports": [
"portable-net45+win8+dnxcore50",
"portable-net45+win8"
]
},
"Microsoft.Extensions.SecretManager.Tools": {
"version": "1.0.0-rc2-20581",
"version": "1.0.0-rc2-20801",
"imports": "portable-net45+win8+dnxcore50"
}
},
Expand All @@ -75,7 +79,7 @@
}
},

"compilationOptions": {
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
Expand All @@ -90,16 +94,12 @@
"Views",
"appsettings.json",
"web.config"
],

"exclude": [
"node_modules"
]
},

"scripts": {
"prepublish": [ "npm install", "bower install"<% if(!grunt){ %>, "gulp clean", "gulp min"<% } %> ],
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath%" ]
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
},

"tooling": {
Expand Down

0 comments on commit 4b7cddc

Please sign in to comment.