From 573fcd14ba914f588ece816c7883527a7c0d7dc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miskolczi=20Rich=C3=A1rd?= Date: Wed, 22 Nov 2023 14:09:15 +0100 Subject: [PATCH] injected logic dependency into endpoint --- WD7UVN_HFT_2023241.Endpoint/DatabaseController.cs | 9 ++++++++- WD7UVN_HFT_2023241.Endpoint/Startup.cs | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/WD7UVN_HFT_2023241.Endpoint/DatabaseController.cs b/WD7UVN_HFT_2023241.Endpoint/DatabaseController.cs index 5bb7e78..ca6d8a8 100644 --- a/WD7UVN_HFT_2023241.Endpoint/DatabaseController.cs +++ b/WD7UVN_HFT_2023241.Endpoint/DatabaseController.cs @@ -1,5 +1,5 @@ -using WD7UVN_HFT_2023241.Logic; using Microsoft.AspNetCore.Mvc; +using WD7UVN_HFT_2023241.Logic; namespace WD7UVN_HFT_2023241.Endpoint { @@ -7,6 +7,13 @@ namespace WD7UVN_HFT_2023241.Endpoint [Route("api/[controller]")] public class DatabaseController : ControllerBase { + public ILogicServices LogicServices { get; set; } + + public DatabaseController(ILogicServices LogicServices) + { + this.LogicServices = LogicServices; + } + [HttpGet] public IActionResult Get() { diff --git a/WD7UVN_HFT_2023241.Endpoint/Startup.cs b/WD7UVN_HFT_2023241.Endpoint/Startup.cs index 1a20978..2eb50a2 100644 --- a/WD7UVN_HFT_2023241.Endpoint/Startup.cs +++ b/WD7UVN_HFT_2023241.Endpoint/Startup.cs @@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; +using WD7UVN_HFT_2023241.Logic; namespace WD7UVN_HFT_2023241.Endpoint { @@ -16,6 +17,7 @@ namespace WD7UVN_HFT_2023241.Endpoint // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 public void ConfigureServices(IServiceCollection services) { + services.AddSingleton(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.