Skip to content

Commit

Permalink
Feature/update net 5 (dotnet-architecture#487)
Browse files Browse the repository at this point in the history
* Updated ApplicationCore to net 5

* Updated Infrastructure project to net 5

* Updated BlazorShared project to net 5

* Updated PublicApi project to net 5

* Updated Web mvc project to net 5

* Updated BlazorAdmin project to net-5

* Updated FunctionalTests to net 5

* Updated UnitTests project to net 5

* Updated IntegrationTests project to net 5

* Fixed CSS specific bug in BlazorAdmin project

* Updated github action worflow yaml

* Changes the name to only .NET

* Removed hardcoded minor version from github action workflow.

* Removed commneted code.

* Removed minor versions from the docker file

* Updated dotnet-ef tool version configuration to net-5

* Removed old migration plans

* Added net5 migration plans

* Updated infrastructure projecti setting.

* Removed database error page related configuration

* Removed commented package.
  • Loading branch information
Sumit Ghosh authored Dec 3, 2020
1 parent 3463c89 commit 28af164
Show file tree
Hide file tree
Showing 42 changed files with 818 additions and 2,905 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
dotnet-version: '5.0.x'

- name: Build with dotnet
run: dotnet build ./eShopOnWeb.sln --configuration Release
Expand Down
10 changes: 5 additions & 5 deletions src/ApplicationCore/ApplicationCore.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<RootNamespace>Microsoft.eShopWeb.ApplicationCore</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Ardalis.GuardClauses" Version="1.5.0" />
<PackageReference Include="Ardalis.Specification" Version="4.0.0" />
<PackageReference Include="MediatR" Version="8.0.2" />
<PackageReference Include="Ardalis.GuardClauses" Version="3.0.1" />
<PackageReference Include="Ardalis.Specification" Version="4.1.0" />
<PackageReference Include="MediatR" Version="9.0.0" />
<PackageReference Include="System.Security.Claims" Version="4.3.0" />
<PackageReference Include="System.Text.Json" Version="4.7.2" />
<PackageReference Include="System.Text.Json" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
60 changes: 29 additions & 31 deletions src/BlazorAdmin/BlazorAdmin.csproj
Original file line number Diff line number Diff line change
@@ -1,37 +1,35 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<RazorLangVersion>3.0</RazorLangVersion>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Blazored.LocalStorage" Version="2.1.6" />
<PackageReference Include="BlazorInputFile" Version="0.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="3.1.5" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="3.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="3.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Build" Version="3.2.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="3.2.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.Extensions.Identity.Core" Version="3.1.5" />
<PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="3.1.6" />
<PackageReference Include="System.Net.Http.Json" Version="3.2.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Blazored.LocalStorage" Version="3.0.0" />
<PackageReference Include="BlazorInputFile" Version="0.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="5.0.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.Extensions.Identity.Core" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="5.0.0" />
<PackageReference Include="System.Net.Http.Json" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\BlazorShared\BlazorShared.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BlazorShared\BlazorShared.csproj" />
</ItemGroup>

<ItemGroup>
<Compile Update="Services\CatalogItem\Delete.EditCatalogItemResult.cs">
<DependentUpon>Delete.cs</DependentUpon>
</Compile>
<Compile Update="Services\CatalogItem\GetById.EditCatalogItemResult.cs">
<DependentUpon>GetById.cs</DependentUpon>
</Compile>
<Compile Update="Services\CatalogItem\Edit.CreateCatalogItemResult.cs">
<DependentUpon>Edit.cs</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Update="Services\CatalogItem\Delete.EditCatalogItemResult.cs">
<DependentUpon>Delete.cs</DependentUpon>
</Compile>
<Compile Update="Services\CatalogItem\GetById.EditCatalogItemResult.cs">
<DependentUpon>GetById.cs</DependentUpon>
</Compile>
<Compile Update="Services\CatalogItem\Edit.CreateCatalogItemResult.cs">
<DependentUpon>Edit.cs</DependentUpon>
</Compile>
</ItemGroup>

</Project>
12 changes: 5 additions & 7 deletions src/BlazorAdmin/Pages/CatalogItemPage/Create.razor
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

@namespace BlazorAdmin.Pages.CatalogItemPage



<div class="modal @_modalClass" tabindex="-1" role="dialog" style="display:@_modalDisplay">
<div class="modal-dialog" role="document">
<div class="modal-content">
Expand Down Expand Up @@ -55,9 +53,9 @@
<div class="col-md-12">
<InputSelect @bind-Value="_item.CatalogBrandId" class="form-control">
@foreach (var brand in Brands)
{
{
<option value="@brand.Id">@brand.Name</option>
}
}
</InputSelect>
<ValidationMessage For="(() => _item.CatalogBrandId)" />
</div>
Expand All @@ -68,9 +66,9 @@
<div class="col-md-12">
<InputSelect @bind-Value="_item.CatalogTypeId" class="form-control">
@foreach (var type in Types)
{
{
<option value="@type.Id">@type.Name</option>
}
}
</InputSelect>
<ValidationMessage For="(() => _item.CatalogTypeId)" />
</div>
Expand All @@ -88,7 +86,7 @@
<label class="control-label col-md-6">@_item.PictureName</label>
<div class="row">
<div class="col-md-6 esh-form-information">
<InputFile OnChange="AddFile" />
<BlazorInputFile.InputFile OnChange="AddFile"/>
</div>
<div class="col-md-6 esh-form-information">
@if (HasPicture)
Expand Down
2 changes: 1 addition & 1 deletion src/BlazorAdmin/Pages/CatalogItemPage/Edit.razor
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<label class="control-label col-md-6">@_item.PictureName</label>
<div class="row">
<div class="col-md-6 esh-form-information">
<InputFile OnChange="ChangeFile" />
<BlazorInputFile.InputFile OnChange="ChangeFile" />
</div>
<div class="col-md-6 esh-form-information">
@if (HasPicture)
Expand Down
4 changes: 2 additions & 2 deletions src/BlazorAdmin/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class Program
public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("admin");
builder.RootComponents.Add<App>("#admin");

var baseUrlConfig = new BaseUrlConfiguration();
builder.Configuration.Bind(BaseUrlConfiguration.CONFIG_NAME, baseUrlConfig);
Expand All @@ -39,7 +39,7 @@ public static async Task Main(string[] args)

await ClearLocalStorageCache(builder.Services);

builder.Build().RunAsync();
await builder.Build().RunAsync();
}

private static async Task ClearLocalStorageCache(IServiceCollection services)
Expand Down
1 change: 1 addition & 0 deletions src/BlazorAdmin/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"commandName": "IISExpress",
"launchBrowser": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
Expand Down
25 changes: 12 additions & 13 deletions src/BlazorAdmin/Shared/MainLayout.razor
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,21 @@
@Body
</div>
</div>

@code
@code
{
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
protected override async Task OnAfterRenderAsync(bool firstRender)
{
var authState = await AuthStateProvider.GetAuthenticationStateAsync();

if(authState.User == null)
if (firstRender)
{
await new Route(JSRuntime).RouteOutside("/Identity/Account/Login");
var authState = await AuthStateProvider.GetAuthenticationStateAsync();

if (authState.User == null)
{
await new Route(JSRuntime).RouteOutside("/Identity/Account/Login");
}
CallRequestRefresh();
}
CallRequestRefresh();
}

await base.OnAfterRenderAsync(firstRender);
await base.OnAfterRenderAsync(firstRender);
}
}
}
14 changes: 14 additions & 0 deletions src/BlazorAdmin/wwwroot/appsettings.Development.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"baseUrls": {
"apiBase": "https://localhost:5099/api/",
"webBase": "https://localhost:44315/"
},
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"System": "Warning"
}
}
}
10 changes: 3 additions & 7 deletions src/BlazorAdmin/wwwroot/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ a, .btn-link {
border-color: #1861ac;
}

admin {
#admin {
position: relative;
display: flex;
flex-direction: column;
display: flex;
}

.top-row {
Expand Down Expand Up @@ -168,10 +167,7 @@ admin {
}
}

@media (min-width: 768px) {
admin {
flex-direction: row;
}
@media (min-width: 768px) {

.sidebar {
width: 250px;
Expand Down
2 changes: 1 addition & 1 deletion src/BlazorShared/BlazorShared.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<RootNamespace>BlazorShared</RootNamespace>
<AssemblyName>BlazorShared</AssemblyName>
</PropertyGroup>
Expand Down
Loading

0 comments on commit 28af164

Please sign in to comment.