Update init metodi DB

This commit is contained in:
Samuele Locatelli
2025-08-09 10:59:09 +02:00
parent cf0d4e2aed
commit fde97319a1
9 changed files with 16 additions and 15 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ namespace EgwCoreLib.Lux.Data
public AdminContext(DbContextOptions<AdminContext> options) : base(options)
{
}
}
#endregion Public Constructors
@@ -141,7 +141,7 @@ namespace EgwCoreLib.Lux.Data.Controllers
{
dbResult = dbCtx
.DbSetItem
.Where(x => (string.IsNullOrEmpty(CodGroup) || x.CodGroup == CodGroup)
.Where(x => (string.IsNullOrEmpty(CodGroup) || x.CodGroup == CodGroup)
&& (ItemType == ItemClassType.ND || x.ItemType == ItemType))
.ToList();
}
@@ -236,7 +236,7 @@ namespace EgwCoreLib.Lux.Data.Controllers
.Where(x => (string.IsNullOrEmpty(CodGroup) || x.CodGroup == CodGroup)
&& (ItemType == ItemClassType.ND || x.ItemType == ItemType)
&& (string.IsNullOrEmpty(SearchVal) ||
x.Description.Contains(SearchVal, StringComparison.InvariantCultureIgnoreCase) ||
x.Description.Contains(SearchVal, StringComparison.InvariantCultureIgnoreCase) ||
x.ExtItemCode.Contains(SearchVal, StringComparison.InvariantCultureIgnoreCase) ||
x.SupplCode.Contains(SearchVal, StringComparison.InvariantCultureIgnoreCase))
)
@@ -166,16 +166,15 @@ namespace EgwCoreLib.Lux.Data.Services
/// <param name="CodGroup"></param>
/// <param name="ItemType"></param>
/// <returns></returns>
public async Task<List<ItemModel>> ItemGetFiltAsync(string SearchVal, string CodGroup, ItemClassType ItemType)
public async Task<List<ItemModel>> ItemGetFiltAsync(string CodGroup, ItemClassType ItemType)
{
string source = "DB";
Stopwatch sw = new Stopwatch();
sw.Start();
List<ItemModel>? result = new List<ItemModel>();
// cerco in redis...
string searchTok = string.IsNullOrEmpty(SearchVal) ? "ALL" : SearchVal;
string groupTok = string.IsNullOrEmpty(CodGroup) ? "ALL" : CodGroup;
string currKey = $"{redisBaseKey}:Item:Filt:{groupTok}:{ItemType}:{searchTok}";
string currKey = $"{redisBaseKey}:Item:Filt:{groupTok}:{ItemType}";
RedisValue rawData = await redisDb.StringGetAsync(currKey);
if (rawData.HasValue)
{
@@ -184,7 +183,7 @@ namespace EgwCoreLib.Lux.Data.Services
}
else
{
result = await dbController.ItemGetFiltAsync(SearchVal, CodGroup, ItemType);
result = await dbController.ItemGetFiltAsync(CodGroup, ItemType);
// serializzo e salvo con config x evitare loop...
rawData = JsonConvert.SerializeObject(result, JSSettings);
await redisDb.StringSetAsync(currKey, rawData, LongCache);
@@ -409,7 +408,7 @@ namespace EgwCoreLib.Lux.Data.Services
{
bool answ = false;
/*******************************
* Recupero elenco dei server da cui cancellare le chaivi:
* Recupero elenco dei server da cui cancellare le chiavi:
* - prendo solo i server connessi
* - prendo solo NON repliche (= master)
* - me ne aspetto 1 in uscita cmq
@@ -432,7 +431,7 @@ namespace EgwCoreLib.Lux.Data.Services
if (numPar > 0)
{
var options = new ParallelOptions { MaxDegreeOfParallelism = numPar };
Parallel.ForEachAsync(keyList, async (item, token) =>
Parallel.ForEach(keyList, (item, token) =>
{
// cancello
redisDb.KeyDelete(item);
+3 -1
View File
@@ -39,8 +39,10 @@ namespace EgwCoreLib.Lux.Data.Services
public void Dispose()
{
#if false
redisDb = null;
redisSub = null;
redisSub = null;
#endif
}
/// <summary>
+1 -1
View File
@@ -4,7 +4,7 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>0.9.2508.0909</Version>
<Version>0.9.2508.0910</Version>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>aspnet-Lux.UI-a758c101-a2f4-4e38-977d-1c4887dbbd50</UserSecretsId>
<Version>0.9.2508.0909</Version>
<Version>0.9.2508.0910</Version>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>LUX - Web Windows MES</i>
<h4>Versione: 0.9.2508.0909</h4>
<h4>Versione: 0.9.2508.0910</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
0.9.2508.0909
0.9.2508.0910
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>0.9.2508.0909</version>
<version>0.9.2508.0910</version>
<url>http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip</url>
<changelog>http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html</changelog>
<mandatory>false</mandatory>