HelperNuget

This commit is contained in:
2024-04-18 09:11:39 -07:00
parent 135f236b8c
commit 4eb70db231
10 changed files with 283 additions and 2 deletions

View File

@ -35,8 +35,10 @@ internal static partial class HelperEDADatabase
{
Stream stream = ToStream(@this.Trim());
XmlReader? reader = XmlReader.Create(stream, new XmlReaderSettings() { ConformanceLevel = ConformanceLevel.Document });
#pragma warning disable IL2026, IL2090
XmlSerializer xmlSerializer = new(typeof(T), typeof(T).GetNestedTypes());
result = xmlSerializer.Deserialize(reader);
#pragma warning restore IL2026, IL2090
stream.Dispose();
}
catch (Exception)
@ -131,7 +133,9 @@ internal static partial class HelperEDADatabase
continue;
// cSpell:enable
common.Update(configuration);
#pragma warning disable IL2026, IL3050
json = JsonSerializer.Serialize(configuration, configuration.GetType(), jsonSerializerOptions);
#pragma warning restore IL2026, IL3050
if (common?.UnitName is null)
continue;
fileName = string.Concat(edaObjectFile.Replace(replace, "Partial"), ".csv");
@ -211,7 +215,9 @@ internal static partial class HelperEDADatabase
List<object> row;
StringBuilder sql = new();
string objectTypeDirectory;
#pragma warning disable IL3050
Array objectTypes = Enum.GetValues(typeof(ModuleInstanceTypeName));
#pragma warning restore IL3050
Dictionary<string, Dictionary<ModuleInstanceTypeName, List<List<object>>>> rows = [];
string decrypted = RijndaelEncryption.Decrypt(appSettings.EDADatabaseConfiguration.Password, appSettings.Company);
string connectionString = $"Data Source={appSettings.EDADatabaseConfiguration.TNS}; User Id={appSettings.EDADatabaseConfiguration.UserName}; Password={decrypted};";