From 3d5b7a93f8e53dba6baeb49c2dc1580216870964 Mon Sep 17 00:00:00 2001 From: Zakharov_Rostislav Date: Mon, 6 May 2024 11:31:59 +0400 Subject: [PATCH] add RestApi --- CarShowroom/CarShowroom.sln | 8 +- .../BusinessLogic/SaleLogic.cs | 1 + .../BusinessLogic/ServiceLogic.cs | 1 - .../BusinessLogic/IServiceLogic.cs | 2 +- .../CarShowroomRestApi.csproj | 19 +++ .../Controllers/CarController.cs | 95 +++++++++++++++ .../Controllers/ClientController.cs | 95 +++++++++++++++ .../Controllers/EmployeeController.cs | 113 ++++++++++++++++++ .../Controllers/MakeController.cs | 95 +++++++++++++++ .../Controllers/ModelController.cs | 95 +++++++++++++++ .../Controllers/SaleController.cs | 95 +++++++++++++++ .../Controllers/ServiceController.cs | 95 +++++++++++++++ CarShowroom/CarShowroomRestApi/Program.cs | 47 ++++++++ .../Properties/launchSettings.json | 31 +++++ .../appsettings.Development.json | 8 ++ .../CarShowroomRestApi/appsettings.json | 9 ++ 16 files changed, 806 insertions(+), 3 deletions(-) create mode 100644 CarShowroom/CarShowroomRestApi/CarShowroomRestApi.csproj create mode 100644 CarShowroom/CarShowroomRestApi/Controllers/CarController.cs create mode 100644 CarShowroom/CarShowroomRestApi/Controllers/ClientController.cs create mode 100644 CarShowroom/CarShowroomRestApi/Controllers/EmployeeController.cs create mode 100644 CarShowroom/CarShowroomRestApi/Controllers/MakeController.cs create mode 100644 CarShowroom/CarShowroomRestApi/Controllers/ModelController.cs create mode 100644 CarShowroom/CarShowroomRestApi/Controllers/SaleController.cs create mode 100644 CarShowroom/CarShowroomRestApi/Controllers/ServiceController.cs create mode 100644 CarShowroom/CarShowroomRestApi/Program.cs create mode 100644 CarShowroom/CarShowroomRestApi/Properties/launchSettings.json create mode 100644 CarShowroom/CarShowroomRestApi/appsettings.Development.json create mode 100644 CarShowroom/CarShowroomRestApi/appsettings.json diff --git a/CarShowroom/CarShowroom.sln b/CarShowroom/CarShowroom.sln index ecb200a..df7f51e 100644 --- a/CarShowroom/CarShowroom.sln +++ b/CarShowroom/CarShowroom.sln @@ -9,7 +9,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CarShowroomContracts", "Car EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CarShowroomDatabaseStorage", "CarShowroomDatabaseStorage\CarShowroomDatabaseStorage.csproj", "{7F0A0E4D-6EFD-459D-AFFF-99F3185243F8}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CarShowroomBusinessLogic", "CarShowroomBusinessLogic\CarShowroomBusinessLogic.csproj", "{B0DA0319-2DBC-4785-BA5F-338AD5E3E437}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CarShowroomBusinessLogic", "CarShowroomBusinessLogic\CarShowroomBusinessLogic.csproj", "{B0DA0319-2DBC-4785-BA5F-338AD5E3E437}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CarShowroomRestApi", "CarShowroomRestApi\CarShowroomRestApi.csproj", "{A2A7076D-5EE3-46CA-B52C-D263213CE33D}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -33,6 +35,10 @@ Global {B0DA0319-2DBC-4785-BA5F-338AD5E3E437}.Debug|Any CPU.Build.0 = Debug|Any CPU {B0DA0319-2DBC-4785-BA5F-338AD5E3E437}.Release|Any CPU.ActiveCfg = Release|Any CPU {B0DA0319-2DBC-4785-BA5F-338AD5E3E437}.Release|Any CPU.Build.0 = Release|Any CPU + {A2A7076D-5EE3-46CA-B52C-D263213CE33D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A2A7076D-5EE3-46CA-B52C-D263213CE33D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A2A7076D-5EE3-46CA-B52C-D263213CE33D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A2A7076D-5EE3-46CA-B52C-D263213CE33D}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/CarShowroom/CarShowroomBusinessLogic/BusinessLogic/SaleLogic.cs b/CarShowroom/CarShowroomBusinessLogic/BusinessLogic/SaleLogic.cs index 6f9dc24..468b617 100644 --- a/CarShowroom/CarShowroomBusinessLogic/BusinessLogic/SaleLogic.cs +++ b/CarShowroom/CarShowroomBusinessLogic/BusinessLogic/SaleLogic.cs @@ -47,6 +47,7 @@ namespace CarShowroomBusinessLogic.BusinessLogic public bool Create(SaleDto model) { CheckModel(model); + model.SaleTime = DateTime.Now; if (_saleStorage.Insert(model) == null) { return false; diff --git a/CarShowroom/CarShowroomBusinessLogic/BusinessLogic/ServiceLogic.cs b/CarShowroom/CarShowroomBusinessLogic/BusinessLogic/ServiceLogic.cs index aa1594b..747018a 100644 --- a/CarShowroom/CarShowroomBusinessLogic/BusinessLogic/ServiceLogic.cs +++ b/CarShowroom/CarShowroomBusinessLogic/BusinessLogic/ServiceLogic.cs @@ -3,7 +3,6 @@ using CarShowroomContracts.StorageContracts; using CarShowroomDataModels.Dtos; using CarShowroomDataModels.SearchModel; using CarShowroomDataModels.Views; -using ServiceShowroomContracts.BusinessLogic; using System; using System.Collections.Generic; using System.Linq; diff --git a/CarShowroom/CarShowroomContracts/BusinessLogic/IServiceLogic.cs b/CarShowroom/CarShowroomContracts/BusinessLogic/IServiceLogic.cs index 067308d..6f3911c 100644 --- a/CarShowroom/CarShowroomContracts/BusinessLogic/IServiceLogic.cs +++ b/CarShowroom/CarShowroomContracts/BusinessLogic/IServiceLogic.cs @@ -7,7 +7,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ServiceShowroomContracts.BusinessLogic +namespace CarShowroomContracts.BusinessLogic { public interface IServiceLogic { diff --git a/CarShowroom/CarShowroomRestApi/CarShowroomRestApi.csproj b/CarShowroom/CarShowroomRestApi/CarShowroomRestApi.csproj new file mode 100644 index 0000000..b9795fa --- /dev/null +++ b/CarShowroom/CarShowroomRestApi/CarShowroomRestApi.csproj @@ -0,0 +1,19 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + diff --git a/CarShowroom/CarShowroomRestApi/Controllers/CarController.cs b/CarShowroom/CarShowroomRestApi/Controllers/CarController.cs new file mode 100644 index 0000000..4ea5656 --- /dev/null +++ b/CarShowroom/CarShowroomRestApi/Controllers/CarController.cs @@ -0,0 +1,95 @@ +using CarShowroomContracts.BusinessLogic; +using CarShowroomDataModels.Dtos; +using CarShowroomDataModels.SearchModel; +using CarShowroomDataModels.Views; +using Microsoft.AspNetCore.Mvc; + +namespace CarShowroomRestApi.Controllers +{ + [Route("api/[controller]/[action]")] + [ApiController] + public class CarController : Controller + { + private readonly ILogger _logger; + private readonly ICarLogic _logic; + + public CarController(ILogger logger, ICarLogic car) + { + _logger = logger; + _logic = car; + } + + [HttpGet] + public List? GetCarList() + { + try + { + return _logic.ReadList(null); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка получения списка машин"); + throw; + } + } + + [HttpGet] + public CarView? GetCar(int CarId) + { + try + { + return _logic.ReadElement(new CarSearch + { + Id = CarId + }); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка получения машины по Id={Id}", CarId); + throw; + } + } + + [HttpPost] + public void CreateCar(CarDto model) + { + try + { + _logic.Create(model); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка создания машины"); + throw; + } + } + + [HttpPut] + public void UpdateCar(CarDto model) + { + try + { + _logic.Update(model); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка обновления машины"); + throw; + } + } + + [HttpDelete] + public void DeleteCar(CarDto model) + { + try + { + _logic.Delete(model); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка удаления машины"); + throw; + } + } + } +} diff --git a/CarShowroom/CarShowroomRestApi/Controllers/ClientController.cs b/CarShowroom/CarShowroomRestApi/Controllers/ClientController.cs new file mode 100644 index 0000000..fee158b --- /dev/null +++ b/CarShowroom/CarShowroomRestApi/Controllers/ClientController.cs @@ -0,0 +1,95 @@ +using CarShowroomContracts.BusinessLogic; +using CarShowroomDataModels.Dtos; +using CarShowroomDataModels.SearchModel; +using CarShowroomDataModels.Views; +using Microsoft.AspNetCore.Mvc; + +namespace CarShowroomRestApi.Controllers +{ + [Route("api/[controller]/[action]")] + [ApiController] + public class ClientController : Controller + { + private readonly ILogger _logger; + private readonly IClientLogic _logic; + + public ClientController(ILogger logger, IClientLogic client) + { + _logger = logger; + _logic = client; + } + + [HttpGet] + public List? GetClientList() + { + try + { + return _logic.ReadList(null); + } + catch (Exception ex) + { + _logger.LogError(ex, " "); + throw; + } + } + + [HttpGet] + public ClientView? GetClient(int ClientId) + { + try + { + return _logic.ReadElement(new ClientSearch + { + Id = ClientId + }); + } + catch (Exception ex) + { + _logger.LogError(ex, " Id={Id}", ClientId); + throw; + } + } + + [HttpPost] + public void CreateClient(ClientDto model) + { + try + { + _logic.Create(model); + } + catch (Exception ex) + { + _logger.LogError(ex, " "); + throw; + } + } + + [HttpPut] + public void UpdateClient(ClientDto model) + { + try + { + _logic.Update(model); + } + catch (Exception ex) + { + _logger.LogError(ex, " "); + throw; + } + } + + [HttpDelete] + public void DeleteClient(ClientDto model) + { + try + { + _logic.Delete(model); + } + catch (Exception ex) + { + _logger.LogError(ex, " "); + throw; + } + } + } +} diff --git a/CarShowroom/CarShowroomRestApi/Controllers/EmployeeController.cs b/CarShowroom/CarShowroomRestApi/Controllers/EmployeeController.cs new file mode 100644 index 0000000..66520b7 --- /dev/null +++ b/CarShowroom/CarShowroomRestApi/Controllers/EmployeeController.cs @@ -0,0 +1,113 @@ +using CarShowroomContracts.BusinessLogic; +using CarShowroomDataModels.Dtos; +using CarShowroomDataModels.SearchModel; +using CarShowroomDataModels.Views; +using Microsoft.AspNetCore.Mvc; + +namespace CarShowroomRestApi.Controllers +{ + [Route("api/[controller]/[action]")] + [ApiController] + public class EmployeeController : Controller + { + private readonly ILogger _logger; + private readonly IEmployeeLogic _logic; + + public EmployeeController(ILogger logger, IEmployeeLogic employee) + { + _logger = logger; + _logic = employee; + } + + [HttpGet] + public List? GetEmployeeList() + { + try + { + return _logic.ReadList(null); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка получения списка сотрудников"); + throw; + } + } + + [HttpGet] + public EmployeeView? GetEmployee(int EmployeeId) + { + try + { + return _logic.ReadElement(new EmployeeSearch + { + Id = EmployeeId + }); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка получения сотрудника по Id={Id}", EmployeeId); + throw; + } + } + + [HttpGet] + public EmployeeView? Login(string login, string password) + { + try + { + return _logic.ReadElement(new EmployeeSearch + { + Email = login, + Password = password + }); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка входа в систему"); + throw; + } + } + + [HttpPost] + public void CreateEmployee(EmployeeDto model) + { + try + { + _logic.Create(model); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка создания сотрудника"); + throw; + } + } + + [HttpPut] + public void UpdateEmployee(EmployeeDto model) + { + try + { + _logic.Update(model); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка обновления сотрудника"); + throw; + } + } + + [HttpDelete] + public void DeleteEmployee(EmployeeDto model) + { + try + { + _logic.Delete(model); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка удаления сотрудника"); + throw; + } + } + } +} diff --git a/CarShowroom/CarShowroomRestApi/Controllers/MakeController.cs b/CarShowroom/CarShowroomRestApi/Controllers/MakeController.cs new file mode 100644 index 0000000..7027c27 --- /dev/null +++ b/CarShowroom/CarShowroomRestApi/Controllers/MakeController.cs @@ -0,0 +1,95 @@ +using CarShowroomContracts.BusinessLogic; +using CarShowroomDataModels.Dtos; +using CarShowroomDataModels.SearchModel; +using CarShowroomDataModels.Views; +using Microsoft.AspNetCore.Mvc; + +namespace CarShowroomRestApi.Controllers +{ + [Route("api/[controller]/[action]")] + [ApiController] + public class MakeController : Controller + { + private readonly ILogger _logger; + private readonly IMakeLogic _logic; + + public MakeController(ILogger logger, IMakeLogic make) + { + _logger = logger; + _logic = make; + } + + [HttpGet] + public List? GetMakeList() + { + try + { + return _logic.ReadList(null); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка получения списка марок"); + throw; + } + } + + [HttpGet] + public MakeView? GetMake(int MakeId) + { + try + { + return _logic.ReadElement(new MakeSearch + { + Id = MakeId + }); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка получения марки по Id={Id}", MakeId); + throw; + } + } + + [HttpPost] + public void CreateMake(MakeDto model) + { + try + { + _logic.Create(model); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка создания марки"); + throw; + } + } + + [HttpPut] + public void UpdateMake(MakeDto model) + { + try + { + _logic.Update(model); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка обновления марки"); + throw; + } + } + + [HttpDelete] + public void DeleteMake(MakeDto model) + { + try + { + _logic.Delete(model); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка удаления марки"); + throw; + } + } + } +} diff --git a/CarShowroom/CarShowroomRestApi/Controllers/ModelController.cs b/CarShowroom/CarShowroomRestApi/Controllers/ModelController.cs new file mode 100644 index 0000000..4d7cc3e --- /dev/null +++ b/CarShowroom/CarShowroomRestApi/Controllers/ModelController.cs @@ -0,0 +1,95 @@ +using CarShowroomContracts.BusinessLogic; +using CarShowroomDataModels.Dtos; +using CarShowroomDataModels.SearchModel; +using CarShowroomDataModels.Views; +using Microsoft.AspNetCore.Mvc; + +namespace CarShowroomRestApi.Controllers +{ + [Route("api/[controller]/[action]")] + [ApiController] + public class ModelController : Controller + { + private readonly ILogger _logger; + private readonly IModelLogic _logic; + + public ModelController(ILogger logger, IModelLogic model) + { + _logger = logger; + _logic = model; + } + + [HttpGet] + public List? GetModelList() + { + try + { + return _logic.ReadList(null); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка получения списка моделей"); + throw; + } + } + + [HttpGet] + public ModelView? GetModel(int ModelId) + { + try + { + return _logic.ReadElement(new ModelSearch + { + Id = ModelId + }); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка получения модели по Id={Id}", ModelId); + throw; + } + } + + [HttpPost] + public void CreateModel(ModelDto model) + { + try + { + _logic.Create(model); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка создания модели"); + throw; + } + } + + [HttpPut] + public void UpdateModel(ModelDto model) + { + try + { + _logic.Update(model); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка обновления модели"); + throw; + } + } + + [HttpDelete] + public void DeleteModel(ModelDto model) + { + try + { + _logic.Delete(model); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка удаления модели"); + throw; + } + } + } +} diff --git a/CarShowroom/CarShowroomRestApi/Controllers/SaleController.cs b/CarShowroom/CarShowroomRestApi/Controllers/SaleController.cs new file mode 100644 index 0000000..043f52c --- /dev/null +++ b/CarShowroom/CarShowroomRestApi/Controllers/SaleController.cs @@ -0,0 +1,95 @@ +using CarShowroomContracts.BusinessLogic; +using CarShowroomDataModels.Dtos; +using CarShowroomDataModels.SearchModel; +using CarShowroomDataModels.Views; +using Microsoft.AspNetCore.Mvc; + +namespace CarShowroomRestApi.Controllers +{ + [Route("api/[controller]/[action]")] + [ApiController] + public class SaleController : Controller + { + private readonly ILogger _logger; + private readonly ISaleLogic _logic; + + public SaleController(ILogger logger, ISaleLogic sale) + { + _logger = logger; + _logic = sale; + } + + [HttpGet] + public List? GetSaleList() + { + try + { + return _logic.ReadList(null); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка получения списка продаж"); + throw; + } + } + + [HttpGet] + public SaleView? GetSale(int SaleId) + { + try + { + return _logic.ReadElement(new SaleSearch + { + Id = SaleId + }); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка получения продажи по Id={Id}", SaleId); + throw; + } + } + + [HttpPost] + public void CreateSale(SaleDto model) + { + try + { + _logic.Create(model); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка создания продажи"); + throw; + } + } + + [HttpPut] + public void UpdateSale(SaleDto model) + { + try + { + _logic.Update(model); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка обновления продажи"); + throw; + } + } + + [HttpDelete] + public void DeleteSale(SaleDto model) + { + try + { + _logic.Delete(model); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка удаления продажи"); + throw; + } + } + } +} diff --git a/CarShowroom/CarShowroomRestApi/Controllers/ServiceController.cs b/CarShowroom/CarShowroomRestApi/Controllers/ServiceController.cs new file mode 100644 index 0000000..689c93d --- /dev/null +++ b/CarShowroom/CarShowroomRestApi/Controllers/ServiceController.cs @@ -0,0 +1,95 @@ +using CarShowroomContracts.BusinessLogic; +using CarShowroomDataModels.Dtos; +using CarShowroomDataModels.SearchModel; +using CarShowroomDataModels.Views; +using Microsoft.AspNetCore.Mvc; + +namespace CarShowroomRestApi.Controllers +{ + [Route("api/[controller]/[action]")] + [ApiController] + public class ServiceController : Controller + { + private readonly ILogger _logger; + private readonly IServiceLogic _logic; + + public ServiceController(ILogger logger, IServiceLogic service) + { + _logger = logger; + _logic = service; + } + + [HttpGet] + public List? GetServiceList() + { + try + { + return _logic.ReadList(null); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка получения списка услуг"); + throw; + } + } + + [HttpGet] + public ServiceView? GetService(int ServiceId) + { + try + { + return _logic.ReadElement(new ServiceSearch + { + Id = ServiceId + }); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка получения услуги по Id={Id}", ServiceId); + throw; + } + } + + [HttpPost] + public void CreateService(ServiceDto model) + { + try + { + _logic.Create(model); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка создания услуги"); + throw; + } + } + + [HttpPut] + public void UpdateService(ServiceDto model) + { + try + { + _logic.Update(model); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка обновления услуги"); + throw; + } + } + + [HttpDelete] + public void DeleteService(ServiceDto model) + { + try + { + _logic.Delete(model); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка удаления услуги"); + throw; + } + } + } +} diff --git a/CarShowroom/CarShowroomRestApi/Program.cs b/CarShowroom/CarShowroomRestApi/Program.cs new file mode 100644 index 0000000..0215c78 --- /dev/null +++ b/CarShowroom/CarShowroomRestApi/Program.cs @@ -0,0 +1,47 @@ +using CarShowroomBusinessLogic.BusinessLogic; +using CarShowroomContracts.BusinessLogic; +using CarShowroomContracts.StorageContracts; +using CarShowroomDatabaseStorage.Storages; +using Microsoft.OpenApi.Models; +var builder = WebApplication.CreateBuilder(args); +builder.Logging.SetMinimumLevel(LogLevel.Trace); +// 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.AddTransient(); +builder.Services.AddTransient(); +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 = "CarShowroomRestApi", + 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", + "CarShowroomRestApi v1")); +} +app.UseHttpsRedirection(); +app.UseAuthorization(); +app.MapControllers(); +app.Run(); \ No newline at end of file diff --git a/CarShowroom/CarShowroomRestApi/Properties/launchSettings.json b/CarShowroom/CarShowroomRestApi/Properties/launchSettings.json new file mode 100644 index 0000000..9b7a0b6 --- /dev/null +++ b/CarShowroom/CarShowroomRestApi/Properties/launchSettings.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:56574", + "sslPort": 44389 + } + }, + "profiles": { + "CarShowroomRestApi": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://localhost:7014;http://localhost:5250", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/CarShowroom/CarShowroomRestApi/appsettings.Development.json b/CarShowroom/CarShowroomRestApi/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/CarShowroom/CarShowroomRestApi/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/CarShowroom/CarShowroomRestApi/appsettings.json b/CarShowroom/CarShowroomRestApi/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/CarShowroom/CarShowroomRestApi/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +}