diff --git a/BlacksmithWorkshop/BlacksmithWorkshop.sln b/BlacksmithWorkshop/BlacksmithWorkshop.sln index 04876d9..8414d25 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshop.sln +++ b/BlacksmithWorkshop/BlacksmithWorkshop.sln @@ -21,7 +21,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlacksmithWorkshopDatabaseI {96E8CFC7-A9D8-438B-AE8C-184ED25D5AAC} = {96E8CFC7-A9D8-438B-AE8C-184ED25D5AAC} EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlacksmithWorkshopRestApi", "BlacksmithWorkshopRestApi\BlacksmithWorkshopRestApi.csproj", "{99EB4314-98EC-44D5-BE69-AD066C4018D3}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlacksmithWorkshopRestApi", "BlacksmithWorkshopRestApi\BlacksmithWorkshopRestApi.csproj", "{E76BFFFD-DC14-4570-8FBF-BAB2F6583F0C}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -57,10 +57,10 @@ Global {07550D11-E516-44E1-88A4-5B21E3EE72CC}.Debug|Any CPU.Build.0 = Debug|Any CPU {07550D11-E516-44E1-88A4-5B21E3EE72CC}.Release|Any CPU.ActiveCfg = Release|Any CPU {07550D11-E516-44E1-88A4-5B21E3EE72CC}.Release|Any CPU.Build.0 = Release|Any CPU - {99EB4314-98EC-44D5-BE69-AD066C4018D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {99EB4314-98EC-44D5-BE69-AD066C4018D3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {99EB4314-98EC-44D5-BE69-AD066C4018D3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {99EB4314-98EC-44D5-BE69-AD066C4018D3}.Release|Any CPU.Build.0 = Release|Any CPU + {E76BFFFD-DC14-4570-8FBF-BAB2F6583F0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E76BFFFD-DC14-4570-8FBF-BAB2F6583F0C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E76BFFFD-DC14-4570-8FBF-BAB2F6583F0C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E76BFFFD-DC14-4570-8FBF-BAB2F6583F0C}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BusinessLogics/ClientLogic.cs b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BusinessLogics/ClientLogic.cs index 9f56f35..729b4f2 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BusinessLogics/ClientLogic.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BusinessLogics/ClientLogic.cs @@ -94,8 +94,7 @@ namespace BlacksmithWorkshopBusinessLogic.BusinessLogics } if (string.IsNullOrEmpty(model.ClientFIO)) { - throw new ArgumentNullException("Нет ФИО клиента", - nameof(model.ClientFIO)); + throw new ArgumentNullException(nameof(model.ClientFIO)); } if (string.IsNullOrEmpty(model.Email)) { diff --git a/BlacksmithWorkshop/BlacksmithWorkshopRestApi/BlacksmithWorkshopRestApi.csproj b/BlacksmithWorkshop/BlacksmithWorkshopRestApi/BlacksmithWorkshopRestApi.csproj index 37fcea7..5609cdc 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopRestApi/BlacksmithWorkshopRestApi.csproj +++ b/BlacksmithWorkshop/BlacksmithWorkshopRestApi/BlacksmithWorkshopRestApi.csproj @@ -1,9 +1,9 @@ - + - net8.0 - enable - enable + net8.0 + enable + enable @@ -22,14 +22,10 @@ - - - - - - - - + + + + diff --git a/BlacksmithWorkshop/BlacksmithWorkshopRestApi/Program.cs b/BlacksmithWorkshop/BlacksmithWorkshopRestApi/Program.cs index c977bb3..b16ab9b 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopRestApi/Program.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopRestApi/Program.cs @@ -1,54 +1,40 @@ -using BlacksmithWorkshopBusinessLogic.BusinessLogics; +using BlacksmithWorkshopBusinessLogic.BusinessLogics; using BlacksmithWorkshopContracts.BusinessLogicsContracts; using BlacksmithWorkshopContracts.StoragesContracts; using BlacksmithWorkshopDatabaseImplement.Implements; -using Microsoft.AspNetCore.Builder; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; using Microsoft.OpenApi.Models; - -namespace BlacksmithWorkshopRestApi +var builder = WebApplication.CreateBuilder(args); +builder.Logging.SetMinimumLevel(LogLevel.Trace); +builder.Logging.AddLog4Net("log4net.config"); +// Add services to the container. +builder.Services.AddTransient(); +builder.Services.AddTransient(); +builder.Services.AddTransient(); +builder.Services.AddTransient(); +builder.Services.AddTransient(); +builder.Services.AddTransient(); +builder.Services.AddControllers(); +// Learn more about configuring Swagger/OpenAPI at +//https://aka.ms/aspnetcore/swashbuckle +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(c => { - internal class Program + c.SwaggerDoc("v1", new OpenApiInfo { - private static void Main(string[] args) - { - var builder = WebApplication.CreateBuilder(args); - builder.Logging.SetMinimumLevel(LogLevel.Trace); - builder.Logging.AddLog4Net("log4net.config"); - // Add services to the container. - builder.Services.AddTransient(); - builder.Services.AddTransient(); - builder.Services.AddTransient(); - builder.Services.AddTransient(); - builder.Services.AddTransient(); - builder.Services.AddTransient(); - builder.Services.AddControllers(); - // Learn more about configuring Swagger/OpenAPI at - //https://aka.ms/aspnetcore/swashbuckle - builder.Services.AddEndpointsApiExplorer(); - builder.Services.AddSwaggerGen(c => - { - c.SwaggerDoc("v1", new OpenApiInfo - { - Title = "BlacksmithWorkshopRestApi", - Version - = "v1" - }); - }); - var app = builder.Build(); - // Configure the HTTP request pipeline. - if (app.Environment.IsDevelopment()) - { - app.UseSwagger(); - app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", - "BlacksmithWorkshopRestApi v1")); - } - app.UseHttpsRedirection(); - app.UseAuthorization(); - app.MapControllers(); - app.Run(); - } - } + Title = "BlacksmithWorkshopRestApi", + Version + = "v1" + }); +}); +var app = builder.Build(); +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) +{ + app.UseSwagger(); + app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", + "BlacksmithWorkshopRestApi v1")); } +app.UseHttpsRedirection(); +app.UseAuthorization(); +app.MapControllers(); +app.Run(); \ No newline at end of file diff --git a/BlacksmithWorkshop/BlacksmithWorkshopRestApi/Properties/launchSettings.json b/BlacksmithWorkshop/BlacksmithWorkshopRestApi/Properties/launchSettings.json index 420bcb7..446cc15 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopRestApi/Properties/launchSettings.json +++ b/BlacksmithWorkshop/BlacksmithWorkshopRestApi/Properties/launchSettings.json @@ -1,31 +1,31 @@ -{ - "$schema": "https://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:27506", - "sslPort": 44307 - } - }, - "profiles": { - "BlacksmithWorkshopShopRestApi": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": true, - "launchUrl": "swagger", - "applicationUrl": "https://localhost:7130;http://localhost:5189", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "launchUrl": "swagger", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:27506", + "sslPort": 44307 + } + }, + "profiles": { + "BlacksmithWorkshopShopRestApi": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://localhost:7130;http://localhost:5189", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } } \ No newline at end of file diff --git a/BlacksmithWorkshop/BlacksmithWorkshopRestApi/appsettings.Development.json b/BlacksmithWorkshop/BlacksmithWorkshopRestApi/appsettings.Development.json index 6ea7671..0c208ae 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopRestApi/appsettings.Development.json +++ b/BlacksmithWorkshop/BlacksmithWorkshopRestApi/appsettings.Development.json @@ -1,8 +1,8 @@ { - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - } + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } } diff --git a/BlacksmithWorkshop/BlacksmithWorkshopRestApi/appsettings.json b/BlacksmithWorkshop/BlacksmithWorkshopRestApi/appsettings.json index 9c3a5de..10f68b8 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopRestApi/appsettings.json +++ b/BlacksmithWorkshop/BlacksmithWorkshopRestApi/appsettings.json @@ -1,9 +1,9 @@ { - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*" + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" }