Refactored and fixed errors
This commit is contained in:
		| @@ -1,3 +1,4 @@ | ||||
| using ApplicationLayer.VisaApplications.Handlers; | ||||
| using ApplicationLayer.VisaApplications.Requests; | ||||
| using Microsoft.AspNetCore.Mvc; | ||||
|  | ||||
| @@ -5,17 +6,18 @@ namespace SchengenVisaApi.Controllers; | ||||
|  | ||||
| [ApiController] | ||||
| [Route("[controller]")] | ||||
| public class VisaApplicationController : ControllerBase | ||||
| public class VisaApplicationController(IVisaApplicationsRequestHandler visaApplicationsRequestHandler) : ControllerBase | ||||
| { | ||||
|  | ||||
|     public VisaApplicationController() | ||||
|     [HttpGet] | ||||
|     public async Task<IActionResult> Get(CancellationToken cancellationToken) | ||||
|     { | ||||
|  | ||||
|         } | ||||
|         var result = await visaApplicationsRequestHandler.Get(cancellationToken); | ||||
|         return Ok(result); | ||||
|     } | ||||
|  | ||||
|     [HttpPost] | ||||
|     public void Create(CreateVisaApplicationRequest request) | ||||
|     public void Create(VisaApplicationCreateRequest request, CancellationToken cancellationToken) | ||||
|     { | ||||
|             throw new NotImplementedException(); | ||||
|         } | ||||
|         visaApplicationsRequestHandler.HandleCreateRequest(request, cancellationToken); | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,4 +1,5 @@ | ||||
| using System.Reflection; | ||||
| using ApplicationLayer; | ||||
| using Infrastructure; | ||||
|  | ||||
| namespace SchengenVisaApi; | ||||
| @@ -11,6 +12,7 @@ public static class DependencyInjection | ||||
|     { | ||||
|         services | ||||
|             .AddInfrastructure() | ||||
|             .AddApplicationLayer() | ||||
|             .AddPresentation(); | ||||
|  | ||||
|         return services; | ||||
| @@ -27,4 +29,4 @@ public static class DependencyInjection | ||||
|             options.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory, xmlFilename)); | ||||
|         }); | ||||
|     } | ||||
| } | ||||
| } | ||||
|   | ||||
| @@ -4,7 +4,6 @@ | ||||
|         <TargetFramework>net8.0</TargetFramework> | ||||
|         <Nullable>enable</Nullable> | ||||
|         <ImplicitUsings>enable</ImplicitUsings> | ||||
|         <InvariantGlobalization>true</InvariantGlobalization> | ||||
|         <GenerateDocumentationFile>true</GenerateDocumentationFile> | ||||
|     </PropertyGroup> | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user