fix controllo variabili passate metodo listvalues

This commit is contained in:
zaccaria.majid
2023-04-06 15:11:05 +02:00
parent 2e00ea39a7
commit c07709cd68
@@ -1,5 +1,6 @@
using Microsoft.Data.SqlClient;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
using Microsoft.Extensions.Configuration;
using NLog;
using System.Data;
@@ -507,12 +508,32 @@ namespace WebDoorCreator.Data.Controllers
{
try
{
// extracting entire set
dbResult = localDbCtx
.DbSetValues
.Where(x => (x.TableName == tableName || x.TableName.Contains(tableName)) && (x.FieldName == fieldName))
.OrderBy(x => x.Ordinal)
.ToList();
if (tableName != "*" && fieldName != "*")
{
// extracting entire set
dbResult = localDbCtx
.DbSetValues
.Where(x => (x.TableName == tableName) && (x.FieldName == fieldName))
.OrderBy(x => x.Ordinal)
.ToList();
}
else if(tableName == "*" && fieldName != "*")
{
dbResult = localDbCtx
.DbSetValues
.Where(x => (x.FieldName == fieldName))
.OrderBy(x => x.Ordinal)
.ToList();
}
else if (tableName != "*" && fieldName == "*")
{
dbResult = localDbCtx
.DbSetValues
.Where(x => (x.TableName == tableName))
.OrderBy(x => x.Ordinal)
.ToList();
}
}
catch (Exception exc)
{
@@ -554,7 +575,7 @@ namespace WebDoorCreator.Data.Controllers
fatto = true;
fatto = true;
}
catch (Exception exc)