BusinessMgr 3.0.2 .Net8

This commit is contained in:
Andy Howard
2025-11-20 17:17:40 +00:00
parent e3cb2b26fe
commit 796dd7cc2b
24 changed files with 142 additions and 136 deletions
+2 -5
View File
@@ -1,9 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
namespace Sarand.Net.Standard.Base.Utils
{
@@ -27,10 +25,9 @@ namespace Sarand.Net.Standard.Base.Utils
#pragma warning restore CS0649
};
public static DateTime GetBuildDateTime (this Assembly assembly)
public static DateTime GetBuildDateTime(this Assembly assembly)
{
// Not available until .Net Standard 1.5.
var path = assembly.GetName().CodeBase;
var path = assembly.Location;
if (File.Exists(path))
{
var buffer = new byte[Math.Max(Marshal.SizeOf(typeof(_IMAGE_FILE_HEADER)), 4)];
+1 -1
View File
@@ -579,7 +579,7 @@ namespace Sarand.Net.Standard.Base.Utils
}
catch (Exception exc)
{
SaLogger.Debug("DateUtil.Format Exception: " + exc.Message);
SaLogger.Debug($"DateUtil.Format {ExceptionUtil.GetErrorStateMessage(exc)}");
}
return String.Empty;
}
@@ -1,8 +1,6 @@
using Newtonsoft.Json;
using System;
using System.IO;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;
using System.Xml.Serialization;
@@ -20,9 +18,6 @@ namespace Sarand.Net.Standard.Base.Utils
/// <returns>The copied object.</returns>
public static T DeepCopy<T>(T source)
{
if (!typeof(T).IsSerializable)
throw new ArgumentException("The type must be serializable.", "source");
// Don't serialize a null object, simply return the default for that object
if (Object.ReferenceEquals(source, null))
return default(T);
@@ -40,7 +35,6 @@ namespace Sarand.Net.Standard.Base.Utils
// Serialize using JSON.
public static String ToJson<T>(T source)
{
if (!typeof(T).IsSerializable) throw new ArgumentException("The type must be serializable.", "source");
// Don't serialize a null object, simply return the default for that object
if (Object.ReferenceEquals(source, null)) return "";
// Serialise to JSON String.
+2 -4
View File
@@ -1,6 +1,4 @@
using Sarand.Net.Standard.Base.App;
using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.Core;
using System;
using System.Collections.Generic;
using System.Globalization;
@@ -665,7 +663,7 @@ namespace Sarand.Net.Standard.Base.Utils
}
catch (Exception exc)
{
SaLogger.Debug("StringUtil.FormatNumeric(double) " + exc.GetType().Name + ": " + exc.Message);
SaLogger.Debug($"StringUtil.FormatNumeric(double) {ExceptionUtil.GetErrorStateMessage(exc)}");
}
return value;
}
@@ -681,7 +679,7 @@ namespace Sarand.Net.Standard.Base.Utils
}
catch (Exception exc)
{
SaLogger.Debug("StringUtil.FormatNumeric(decimal) " + exc.GetType().Name + ": " + exc.Message);
SaLogger.Debug($"StringUtil.FormatNumeric(decimal) {ExceptionUtil.GetErrorStateMessage(exc)}");
}
return value;
}