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.