Feature/update net 5 (#487)

* 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.
This commit is contained in:
Sumit Ghosh
2020-12-03 21:53:11 +05:30
committed by GitHub
parent 3463c89418
commit 28af1642f6
42 changed files with 830 additions and 2917 deletions

View File

@@ -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>

View File

@@ -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">
@@ -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>
@@ -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>
@@ -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)

View File

@@ -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)

View File

@@ -17,7 +17,7 @@ namespace BlazorAdmin
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);
@@ -39,7 +39,7 @@ namespace BlazorAdmin
await ClearLocalStorageCache(builder.Services);
builder.Build().RunAsync();
await builder.Build().RunAsync();
}
private static async Task ClearLocalStorageCache(IServiceCollection services)

View File

@@ -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"
}

View File

@@ -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");
}
CallRequestRefresh();
}
var authState = await AuthStateProvider.GetAuthenticationStateAsync();
await base.OnAfterRenderAsync(firstRender);
if (authState.User == null)
{
await new Route(JSRuntime).RouteOutside("/Identity/Account/Login");
}
CallRequestRefresh();
}
await base.OnAfterRenderAsync(firstRender);
}
}
}

View File

@@ -0,0 +1,14 @@
{
"baseUrls": {
"apiBase": "https://localhost:5099/api/",
"webBase": "https://localhost:44315/"
},
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"System": "Warning"
}
}
}

View File

@@ -14,10 +14,9 @@ a, .btn-link {
border-color: #1861ac;
}
admin {
#admin {
position: relative;
display: flex;
flex-direction: column;
display: flex;
}
.top-row {
@@ -168,10 +167,7 @@ admin {
}
}
@media (min-width: 768px) {
admin {
flex-direction: row;
}
@media (min-width: 768px) {
.sidebar {
width: 250px;