From 009dca4f75e01c3395f660ea0b698049a495f0c4 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 25 Mar 2026 08:32:52 +0100 Subject: [PATCH] Fix global Using in API proj --- Lux.API/Controllers/FileController.cs | 8 +------- Lux.API/Controllers/GenericController.cs | 7 ------- Lux.API/Controllers/ImageController.cs | 8 +------- Lux.API/Controllers/ProdController.cs | 10 +--------- Lux.API/Controllers/WindowController.cs | 7 ------- Lux.API/Controllers/_Using.cs | 5 +++++ Lux.API/GlobalUsings.cs | 5 +++++ Lux.API/Program.cs | 4 ---- Lux.API/Services/ExternalMessageProcessor.cs | 3 --- Lux.API/Services/RedisSubscriberService.cs | 1 - 10 files changed, 13 insertions(+), 45 deletions(-) create mode 100644 Lux.API/Controllers/_Using.cs create mode 100644 Lux.API/GlobalUsings.cs diff --git a/Lux.API/Controllers/FileController.cs b/Lux.API/Controllers/FileController.cs index 33b286b7..b8368873 100644 --- a/Lux.API/Controllers/FileController.cs +++ b/Lux.API/Controllers/FileController.cs @@ -1,10 +1,4 @@ -using EgwCoreLib.Lux.Data.Services.General; -using EgwCoreLib.Lux.Data.Services.Sales; -using EgwMultiEngineManager.Data; -using Microsoft.AspNetCore.Mvc; -using NLog; -using System.Diagnostics; -using System.Reflection; +using EgwCoreLib.Lux.Data.Services.Sales; using System.Text; namespace Lux.API.Controllers diff --git a/Lux.API/Controllers/GenericController.cs b/Lux.API/Controllers/GenericController.cs index 72493495..fd86c776 100644 --- a/Lux.API/Controllers/GenericController.cs +++ b/Lux.API/Controllers/GenericController.cs @@ -1,12 +1,5 @@ using Egw.Window.Data; using EgwCoreLib.Lux.Core.RestPayload; -using EgwCoreLib.Lux.Data.Services; -using EgwCoreLib.Lux.Data.Services.General; -using EgwMultiEngineManager.Data; -using Microsoft.AspNetCore.Mvc; -using NLog; -using System.Diagnostics; -using System.Reflection; namespace Lux.API.Controllers { diff --git a/Lux.API/Controllers/ImageController.cs b/Lux.API/Controllers/ImageController.cs index 03b79d49..493ad0ac 100644 --- a/Lux.API/Controllers/ImageController.cs +++ b/Lux.API/Controllers/ImageController.cs @@ -1,10 +1,4 @@ -using EgwCoreLib.Lux.Data.Services.General; -using EgwMultiEngineManager.Data; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.StaticFiles; -using NLog; -using System.Diagnostics; -using System.Reflection; +using Microsoft.AspNetCore.StaticFiles; using System.Security.Cryptography; using System.Text; diff --git a/Lux.API/Controllers/ProdController.cs b/Lux.API/Controllers/ProdController.cs index b3f51f2b..e2a7932e 100644 --- a/Lux.API/Controllers/ProdController.cs +++ b/Lux.API/Controllers/ProdController.cs @@ -1,12 +1,4 @@ -using EgwCoreLib.Lux.Data.Services.General; -using EgwMultiEngineManager.Data; -using Lux.API.Services; -using Microsoft.AspNetCore.Mvc; -using Newtonsoft.Json; -using NLog; -using System.Diagnostics; -using System.Reflection; -using static EgwCoreLib.Lux.Core.Enums; +using static EgwCoreLib.Lux.Core.Enums; namespace Lux.API.Controllers { diff --git a/Lux.API/Controllers/WindowController.cs b/Lux.API/Controllers/WindowController.cs index 0e79471e..f9efa789 100644 --- a/Lux.API/Controllers/WindowController.cs +++ b/Lux.API/Controllers/WindowController.cs @@ -1,11 +1,4 @@ using EgwCoreLib.Lux.Data.DbModel.Config; -using EgwCoreLib.Lux.Data.Services; -using EgwCoreLib.Lux.Data.Services.General; -using EgwMultiEngineManager.Data; -using Microsoft.AspNetCore.Mvc; -using NLog; -using System.Diagnostics; -using System.Reflection; namespace Lux.API.Controllers { diff --git a/Lux.API/Controllers/_Using.cs b/Lux.API/Controllers/_Using.cs new file mode 100644 index 00000000..6084fecf --- /dev/null +++ b/Lux.API/Controllers/_Using.cs @@ -0,0 +1,5 @@ +global using EgwCoreLib.Lux.Data.Services.General; +global using EgwMultiEngineManager.Data; +global using Microsoft.AspNetCore.Mvc; +global using System.Diagnostics; +global using System.Reflection; \ No newline at end of file diff --git a/Lux.API/GlobalUsings.cs b/Lux.API/GlobalUsings.cs new file mode 100644 index 00000000..d9bba7f3 --- /dev/null +++ b/Lux.API/GlobalUsings.cs @@ -0,0 +1,5 @@ +global using EgwCoreLib.Lux.Data; +global using Lux.API.Services; +global using Newtonsoft.Json; +global using NLog; +global using StackExchange.Redis; diff --git a/Lux.API/Program.cs b/Lux.API/Program.cs index 15702eef..ceee5517 100644 --- a/Lux.API/Program.cs +++ b/Lux.API/Program.cs @@ -1,14 +1,10 @@ -using EgwCoreLib.Lux.Data; using EgwCoreLib.Lux.Data.Services.General; -using Lux.API.Services; using Microsoft.EntityFrameworkCore; using Microsoft.OpenApi.Models; -using NLog; using NLog.Targets; using NLog.Web; using OpenTelemetry.Resources; using OpenTelemetry.Trace; -using StackExchange.Redis; using System.Reflection; var builder = WebApplication.CreateBuilder(args); diff --git a/Lux.API/Services/ExternalMessageProcessor.cs b/Lux.API/Services/ExternalMessageProcessor.cs index cd7b8f3f..579f849f 100644 --- a/Lux.API/Services/ExternalMessageProcessor.cs +++ b/Lux.API/Services/ExternalMessageProcessor.cs @@ -1,9 +1,6 @@ using EgwCoreLib.Lux.Core.RestPayload; using EgwCoreLib.Lux.Data.Services.General; using EgwMultiEngineManager.Data; -using Newtonsoft.Json; -using NLog; -using StackExchange.Redis; using System.Diagnostics; using static Egw.Window.Data.Enums; using static EgwCoreLib.Lux.Core.Enums; diff --git a/Lux.API/Services/RedisSubscriberService.cs b/Lux.API/Services/RedisSubscriberService.cs index 67d2bd72..6fa1737f 100644 --- a/Lux.API/Services/RedisSubscriberService.cs +++ b/Lux.API/Services/RedisSubscriberService.cs @@ -1,5 +1,4 @@ using EgwCoreLib.Lux.Data.Services.Internal; -using StackExchange.Redis; namespace Lux.API.Services {