From d41603a8af1bc4377ba7bcc316614fa61304f645 Mon Sep 17 00:00:00 2001 From: Filip Strajnar Date: Sun, 22 Sep 2024 21:03:36 +0200 Subject: [PATCH] Added GpioService. --- Proculite.GpioRest/Program.cs | 4 ++++ Proculite.GpioRest/Services/GpioService.cs | 11 +++++++++++ 2 files changed, 15 insertions(+) create mode 100644 Proculite.GpioRest/Services/GpioService.cs diff --git a/Proculite.GpioRest/Program.cs b/Proculite.GpioRest/Program.cs index 098de00..6d84ad7 100644 --- a/Proculite.GpioRest/Program.cs +++ b/Proculite.GpioRest/Program.cs @@ -1,3 +1,5 @@ +using Proculite.GpioRest.Services; + var builder = WebApplication.CreateBuilder(args); // Add services to the container. @@ -6,6 +8,8 @@ builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); builder.Services.AddControllers(); +builder.Services.AddSingleton(); + var app = builder.Build(); app.MapControllers(); diff --git a/Proculite.GpioRest/Services/GpioService.cs b/Proculite.GpioRest/Services/GpioService.cs new file mode 100644 index 0000000..d1c5d80 --- /dev/null +++ b/Proculite.GpioRest/Services/GpioService.cs @@ -0,0 +1,11 @@ +namespace Proculite.GpioRest.Services +{ + public class GpioService + { + public readonly ILogger _logger; + public GpioService(ILogger logger) + { + _logger = logger; + } + } +} \ No newline at end of file