This repository has been archived by the owner on Jan 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add workshop for 4.5, rename files and folders
- Loading branch information
Showing
53 changed files
with
313 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,30 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 15 | ||
VisualStudioVersion = 15.0.26020.0 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.28917.182 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{14917E84-0349-44AA-9E50-EECB3DAB9976}" | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{665FCCEE-47C5-4936-ADA0-F7E3A0430E87}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lab4", "src\Lab4\Lab4.csproj", "{3B55DFDA-79ED-4938-903F-5ED05C76ACB7}" | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lab4A", "src\Lab4A\Lab4A.csproj", "{091CD54A-0190-4CFC-A20E-BABD61799536}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Debug|x64 = Debug|x64 | ||
Debug|x86 = Debug|x86 | ||
Release|Any CPU = Release|Any CPU | ||
Release|x64 = Release|x64 | ||
Release|x86 = Release|x86 | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{3B55DFDA-79ED-4938-903F-5ED05C76ACB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{3B55DFDA-79ED-4938-903F-5ED05C76ACB7}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{3B55DFDA-79ED-4938-903F-5ED05C76ACB7}.Debug|x64.ActiveCfg = Debug|Any CPU | ||
{3B55DFDA-79ED-4938-903F-5ED05C76ACB7}.Debug|x64.Build.0 = Debug|Any CPU | ||
{3B55DFDA-79ED-4938-903F-5ED05C76ACB7}.Debug|x86.ActiveCfg = Debug|Any CPU | ||
{3B55DFDA-79ED-4938-903F-5ED05C76ACB7}.Debug|x86.Build.0 = Debug|Any CPU | ||
{3B55DFDA-79ED-4938-903F-5ED05C76ACB7}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{3B55DFDA-79ED-4938-903F-5ED05C76ACB7}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{3B55DFDA-79ED-4938-903F-5ED05C76ACB7}.Release|x64.ActiveCfg = Release|Any CPU | ||
{3B55DFDA-79ED-4938-903F-5ED05C76ACB7}.Release|x64.Build.0 = Release|Any CPU | ||
{3B55DFDA-79ED-4938-903F-5ED05C76ACB7}.Release|x86.ActiveCfg = Release|Any CPU | ||
{3B55DFDA-79ED-4938-903F-5ED05C76ACB7}.Release|x86.Build.0 = Release|Any CPU | ||
{091CD54A-0190-4CFC-A20E-BABD61799536}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{091CD54A-0190-4CFC-A20E-BABD61799536}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{091CD54A-0190-4CFC-A20E-BABD61799536}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{091CD54A-0190-4CFC-A20E-BABD61799536}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(NestedProjects) = preSolution | ||
{3B55DFDA-79ED-4938-903F-5ED05C76ACB7} = {14917E84-0349-44AA-9E50-EECB3DAB9976} | ||
{091CD54A-0190-4CFC-A20E-BABD61799536} = {665FCCEE-47C5-4936-ADA0-F7E3A0430E87} | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {BBA096C2-42FC-405B-BEC2-CB4972578542} | ||
SolutionGuid = {A48721F1-1019-474D-A0B3-01473772CC2D} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.28917.182 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lab4B", "src\Lab4B.csproj", "{1B524C9F-B407-4B89-A53A-B89BE5B371FE}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{1B524C9F-B407-4B89-A53A-B89BE5B371FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{1B524C9F-B407-4B89-A53A-B89BE5B371FE}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{1B524C9F-B407-4B89-A53A-B89BE5B371FE}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{1B524C9F-B407-4B89-A53A-B89BE5B371FE}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {8FF55818-A41B-4C88-BF8C-64D74EECEA0B} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp2.2</TargetFramework> | ||
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.AspNetCore.App" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using Microsoft.AspNetCore; | ||
using Microsoft.AspNetCore.Hosting; | ||
using Microsoft.Extensions.Configuration; | ||
|
||
namespace Lab4B | ||
{ | ||
public class Program | ||
{ | ||
public static void Main(string[] args) | ||
{ | ||
CreateWebHostBuilder(args).Build().Run(); | ||
} | ||
|
||
public static IWebHostBuilder CreateWebHostBuilder(string[] args) => | ||
WebHost.CreateDefaultBuilder(args) | ||
.ConfigureAppConfiguration((builderContext, config) => | ||
{ | ||
config.AddJsonFile("config.json"); | ||
}) | ||
.UseStartup<Startup>(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"iisSettings": { | ||
"windowsAuthentication": false, | ||
"anonymousAuthentication": true, | ||
"iisExpress": { | ||
"applicationUrl": "http://localhost:58029", | ||
"sslPort": 44334 | ||
} | ||
}, | ||
"profiles": { | ||
"IIS Express": { | ||
"commandName": "IISExpress", | ||
"launchBrowser": true, | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
}, | ||
"WebApplication2": { | ||
"commandName": "Project", | ||
"launchBrowser": true, | ||
"applicationUrl": "https://localhost:5001;http://localhost:5000", | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
using Microsoft.AspNetCore.Builder; | ||
using Microsoft.AspNetCore.Http; | ||
using Microsoft.Extensions.Options; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
||
namespace Lab4B | ||
{ | ||
public class RequestCultureMiddleware | ||
{ | ||
private readonly RequestDelegate _next; | ||
private readonly RequestCultureOptions _options; | ||
|
||
public RequestCultureMiddleware(RequestDelegate next, IOptions<RequestCultureOptions> options) | ||
{ | ||
_next = next; | ||
_options = options.Value; | ||
} | ||
|
||
public Task Invoke(HttpContext httpContext) | ||
{ | ||
CultureInfo requestCulture = null; | ||
|
||
var cultureQuery = httpContext.Request.Query["culture"]; | ||
if (!string.IsNullOrWhiteSpace(cultureQuery)) | ||
{ | ||
requestCulture = new CultureInfo(cultureQuery); | ||
} | ||
else | ||
{ | ||
requestCulture = _options.DefaultCulture; | ||
} | ||
|
||
if (requestCulture != null) | ||
{ | ||
CultureInfo.CurrentCulture = requestCulture; | ||
CultureInfo.CurrentUICulture = requestCulture; | ||
} | ||
|
||
return _next(httpContext); | ||
} | ||
} | ||
|
||
public static class RequestCultureMiddlewareExtensions | ||
{ | ||
public static IApplicationBuilder UseRequestCulture(this IApplicationBuilder builder) | ||
{ | ||
return builder.UseMiddleware<RequestCultureMiddleware>(); | ||
} | ||
|
||
public static IApplicationBuilder UseRequestCulture(this IApplicationBuilder builder, RequestCultureOptions options) | ||
{ | ||
return builder.UseMiddleware<RequestCultureMiddleware>(Options.Create(options)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using Microsoft.AspNetCore.Builder; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
||
namespace Lab4B | ||
{ | ||
public class RequestCultureOptions | ||
{ | ||
public CultureInfo DefaultCulture { get; set; } | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.