Unverified Commit d053349a authored by Artak's avatar Artak Committed by GitHub
Browse files

Merge pull request #292 from mkArtak/release/5.0

Update BlazingPizza app to 5.0
parents fddeba9b 0f2f2563
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<AspNetCoreVersion>5.0.0-preview.7.20326.3</AspNetCoreVersion> <AspNetCoreVersion>5.0.0</AspNetCoreVersion>
<BlazorVersion>5.0.0-preview.7.20326.3</BlazorVersion> <BlazorVersion>5.0.0</BlazorVersion>
<EntityFrameworkVersion>5.0.0-preview.7.20326.1</EntityFrameworkVersion> <EntityFrameworkVersion>5.0.0</EntityFrameworkVersion>
<SystemNetHttpJsonVersion>5.0.0-preview.7.20326.1</SystemNetHttpJsonVersion> <SystemNetHttpJsonVersion>5.0.0</SystemNetHttpJsonVersion>
</PropertyGroup> </PropertyGroup>
</Project> </Project>
...@@ -18,7 +18,7 @@ Create a new class called `OrderState` in the Client Project root directory - an ...@@ -18,7 +18,7 @@ Create a new class called `OrderState` in the Client Project root directory - an
public static async Task Main(string[] args) public static async Task Main(string[] args)
{ {
var builder = WebAssemblyHostBuilder.CreateDefault(args); var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("app"); builder.RootComponents.Add<App>("#app");
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
builder.Services.AddScoped<OrderState>(); builder.Services.AddScoped<OrderState>();
......
...@@ -49,7 +49,7 @@ To enable the authentication services, add a call to `AddApiAuthorization` in *P ...@@ -49,7 +49,7 @@ To enable the authentication services, add a call to `AddApiAuthorization` in *P
public static async Task Main(string[] args) public static async Task Main(string[] args)
{ {
var builder = WebAssemblyHostBuilder.CreateDefault(args); var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("app"); builder.RootComponents.Add<App>("#app");
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
builder.Services.AddScoped<OrderState>(); builder.Services.AddScoped<OrderState>();
...@@ -68,8 +68,8 @@ The added services will be configured by default to use an identity provider on ...@@ -68,8 +68,8 @@ The added services will be configured by default to use an identity provider on
```csharp ```csharp
public void ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
services.AddMvc() services.AddControllersWithViews();
.AddNewtonsoftJson(); services.AddRazorPages();
services.AddDbContext<PizzaStoreContext>(options => services.AddDbContext<PizzaStoreContext>(options =>
options.UseSqlite("Data Source=pizza.db")); options.UseSqlite("Data Source=pizza.db"));
......
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework> <TargetFramework>net5.0</TargetFramework>
<LangVersion>7.3</LangVersion>
<RazorLangVersion>3.0</RazorLangVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="$(BlazorVersion)" /> <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="$(BlazorVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="$(BlazorVersion)" /> <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="$(BlazorVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Build" Version="$(BlazorVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.Extensions.Http" Version="$(AspNetCoreVersion)" /> <PackageReference Include="Microsoft.Extensions.Http" Version="$(AspNetCoreVersion)" />
<PackageReference Include="System.Net.Http.Json" Version="$(SystemNetHttpJsonVersion)" /> <PackageReference Include="System.Net.Http.Json" Version="$(SystemNetHttpJsonVersion)" />
</ItemGroup> </ItemGroup>
......
...@@ -11,7 +11,7 @@ namespace BlazingPizza.Client ...@@ -11,7 +11,7 @@ namespace BlazingPizza.Client
public static async Task Main(string[] args) public static async Task Main(string[] args)
{ {
var builder = WebAssemblyHostBuilder.CreateDefault(args); var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("app"); builder.RootComponents.Add<App>("#app");
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
......
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
<title>Blazing Pizza</title> <title>Blazing Pizza</title>
</head> </head>
<body> <body>
<app> <div id="app">
<div class="loading-bar"></div> <div class="loading-bar"></div>
</app> </div>
<div id="blazor-error-ui"> <div id="blazor-error-ui">
An unhandled error has occurred. An unhandled error has occurred.
......
<Project Sdk="Microsoft.NET.Sdk.Razor"> <Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework> <TargetFramework>net5.0</TargetFramework>
<RazorLangVersion>3.0</RazorLangVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components" Version="$(AspNetCoreVersion)" /> <PackageReference Include="Microsoft.AspNetCore.Components" Version="$(AspNetCoreVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="$(AspNetCoreVersion)" /> <PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="$(AspNetCoreVersion)" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<SupportedPlatform Include="browser" />
</ItemGroup>
</Project> </Project>
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework> <TargetFramework>net5.0</TargetFramework>
<LangVersion>7.3</LangVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
......
...@@ -19,8 +19,8 @@ namespace BlazingPizza.Server ...@@ -19,8 +19,8 @@ namespace BlazingPizza.Server
public void ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
services.AddMvc() services.AddControllersWithViews();
.AddNewtonsoftJson(); services.AddRazorPages();
services.AddDbContext<PizzaStoreContext>(options => services.AddDbContext<PizzaStoreContext>(options =>
options.UseSqlite("Data Source=pizza.db")); options.UseSqlite("Data Source=pizza.db"));
......
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework> <TargetFramework>net5.0</TargetFramework>
<LangVersion>7.3</LangVersion>
<RootNamespace>BlazingPizza</RootNamespace> <RootNamespace>BlazingPizza</RootNamespace>
</PropertyGroup> </PropertyGroup>
......
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework> <TargetFramework>net5.0</TargetFramework>
<LangVersion>7.3</LangVersion>
<RazorLangVersion>3.0</RazorLangVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="$(BlazorVersion)" /> <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="$(BlazorVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="$(BlazorVersion)" /> <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="$(BlazorVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Build" Version="$(BlazorVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.Extensions.Http" Version="$(AspNetCoreVersion)" /> <PackageReference Include="Microsoft.Extensions.Http" Version="$(AspNetCoreVersion)" />
<PackageReference Include="System.Net.Http.Json" Version="$(SystemNetHttpJsonVersion)" /> <PackageReference Include="System.Net.Http.Json" Version="$(SystemNetHttpJsonVersion)" />
</ItemGroup> </ItemGroup>
......
...@@ -11,7 +11,7 @@ namespace BlazingPizza.Client ...@@ -11,7 +11,7 @@ namespace BlazingPizza.Client
public static async Task Main(string[] args) public static async Task Main(string[] args)
{ {
var builder = WebAssemblyHostBuilder.CreateDefault(args); var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("app"); builder.RootComponents.Add<App>("#app");
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
......
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
<title>Blazing Pizza</title> <title>Blazing Pizza</title>
</head> </head>
<body> <body>
<app> <div id="app">
<div class="loading-bar"></div> <div class="loading-bar"></div>
</app> </div>
<div id="blazor-error-ui"> <div id="blazor-error-ui">
An unhandled error has occurred. An unhandled error has occurred.
......
<Project Sdk="Microsoft.NET.Sdk.Razor"> <Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework> <TargetFramework>net5.0</TargetFramework>
<RazorLangVersion>3.0</RazorLangVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
...@@ -10,4 +9,8 @@ ...@@ -10,4 +9,8 @@
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="$(AspNetCoreVersion)" /> <PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="$(AspNetCoreVersion)" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<SupportedPlatform Include="browser" />
</ItemGroup>
</Project> </Project>
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework> <TargetFramework>net5.0</TargetFramework>
<LangVersion>7.3</LangVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
......
...@@ -19,8 +19,9 @@ namespace BlazingPizza.Server ...@@ -19,8 +19,9 @@ namespace BlazingPizza.Server
public void ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
services.AddMvc() services.AddControllersWithViews();
.AddNewtonsoftJson(); services.AddRazorPages();
services.AddDbContext<PizzaStoreContext>(options => services.AddDbContext<PizzaStoreContext>(options =>
options.UseSqlite("Data Source=pizza.db")); options.UseSqlite("Data Source=pizza.db"));
......
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework> <TargetFramework>net5.0</TargetFramework>
<LangVersion>7.3</LangVersion>
<RootNamespace>BlazingPizza</RootNamespace> <RootNamespace>BlazingPizza</RootNamespace>
</PropertyGroup> </PropertyGroup>
......
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework> <TargetFramework>net5.0</TargetFramework>
<LangVersion>7.3</LangVersion>
<RazorLangVersion>3.0</RazorLangVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="$(BlazorVersion)" /> <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="$(BlazorVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Build" Version="$(BlazorVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.Extensions.Http" Version="$(AspNetCoreVersion)" /> <PackageReference Include="Microsoft.Extensions.Http" Version="$(AspNetCoreVersion)" />
<PackageReference Include="System.Net.Http.Json" Version="$(SystemNetHttpJsonVersion)" /> <PackageReference Include="System.Net.Http.Json" Version="$(SystemNetHttpJsonVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="$(BlazorVersion)" /> <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="$(BlazorVersion)" />
......
...@@ -11,7 +11,7 @@ namespace BlazingPizza.Client ...@@ -11,7 +11,7 @@ namespace BlazingPizza.Client
public static async Task Main(string[] args) public static async Task Main(string[] args)
{ {
var builder = WebAssemblyHostBuilder.CreateDefault(args); var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("app"); builder.RootComponents.Add<App>("#app");
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
......
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
<title>Blazing Pizza</title> <title>Blazing Pizza</title>
</head> </head>
<body> <body>
<app> <div id="app">
<div class="loading-bar"></div> <div class="loading-bar"></div>
</app> </div>
<div id="blazor-error-ui"> <div id="blazor-error-ui">
An unhandled error has occurred. An unhandled error has occurred.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment