From 8fcbf05b4043f739fa6891a4ceb6d3aa2e8a1aa6 Mon Sep 17 00:00:00 2001 From: Juan Renato Urrea Ortiz Date: Thu, 25 Dec 2025 20:10:36 -0800 Subject: [PATCH 1/9] removed and updated foundation --- CSM Foundation Core.sln | 2 +- CSM Foundation Core/CHANGELOG.md | 12 +++++++ .../CSM Foundation Core.csproj | 2 +- .../Errors/Models/ErrorInfo.cs | 35 ------------------- 4 files changed, 14 insertions(+), 37 deletions(-) delete mode 100644 CSM Foundation Core/Errors/Models/ErrorInfo.cs diff --git a/CSM Foundation Core.sln b/CSM Foundation Core.sln index c9b59dd..01bb2e7 100644 --- a/CSM Foundation Core.sln +++ b/CSM Foundation Core.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 18 -VisualStudioVersion = 18.0.11222.15 d18.0 +VisualStudioVersion = 18.0.11222.15 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSM Foundation Core", "CSM Foundation Core\CSM Foundation Core.csproj", "{E39161C8-353E-40B7-B1E0-ED3E17DCC51F}" EndProject diff --git a/CSM Foundation Core/CHANGELOG.md b/CSM Foundation Core/CHANGELOG.md index 421d6d8..e39a03f 100644 --- a/CSM Foundation Core/CHANGELOG.md +++ b/CSM Foundation Core/CHANGELOG.md @@ -1,5 +1,17 @@ # CSM Foundation Core CHANGELOG +## [3.0.0] - 25.12-2025 + +### Remved + +- Removed from errors model [ErrorInfo] since it was only needed when internal errors are exposed to connected services with critical information. + +#### Dependencies + +| Package | Previous Version | New Version | +|:----------------------------------------|:----------------:|:---------------:| +| | | | + ## [2.1.1] - 24.12-2025 ### Changed diff --git a/CSM Foundation Core/CSM Foundation Core.csproj b/CSM Foundation Core/CSM Foundation Core.csproj index 695fd6f..bc22aef 100644 --- a/CSM Foundation Core/CSM Foundation Core.csproj +++ b/CSM Foundation Core/CSM Foundation Core.csproj @@ -4,7 +4,7 @@ net8.0 CSM_Foundation_Core CSM.Foundation.Core - 2.1.1 + 3.0.0 Renato Urrea Cosmos (CSM) https://github.com/Cosmos-CSM/csm_foundation_core diff --git a/CSM Foundation Core/Errors/Models/ErrorInfo.cs b/CSM Foundation Core/Errors/Models/ErrorInfo.cs deleted file mode 100644 index a0bd8e8..0000000 --- a/CSM Foundation Core/Errors/Models/ErrorInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -namespace CSM_Foundation_Core.Errors.Models; - -/// -/// {model} record for . -/// -/// -/// Stores public information to expose an Exception details. -/// -/// -public record ErrorInfo { - /// - /// Where the exception got thrown. - /// - public required string Trace { get; init; } - - /// - /// Specific exception management situation code. - /// - public required int Situation { get; init; } - - /// - /// User friendly displayable error message. - /// - public required string Advise { get; init; } - - /// - /// Exception message caught at system level. - /// - public required string System { get; init; } - - /// - /// Additional detailed information about the exception. - /// - public Dictionary Factors { get; init; } = []; -} From 293cf705e36fe215b665bff6844f97a3dff4727e Mon Sep 17 00:00:00 2001 From: Juan Renato Urrea Ortiz Date: Wed, 7 Jan 2026 16:37:05 -0800 Subject: [PATCH 2/9] version bump and update for event --- CSM Foundation Core/CSM Foundation Core.csproj | 2 +- .../Errors/Abstractions/Bases/ErrorBase.cs | 2 ++ .../Errors/Abstractions/Interfaces/IError.cs | 8 +++++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CSM Foundation Core/CSM Foundation Core.csproj b/CSM Foundation Core/CSM Foundation Core.csproj index bc22aef..7456938 100644 --- a/CSM Foundation Core/CSM Foundation Core.csproj +++ b/CSM Foundation Core/CSM Foundation Core.csproj @@ -4,7 +4,7 @@ net8.0 CSM_Foundation_Core CSM.Foundation.Core - 3.0.0 + 3.0.1 Renato Urrea Cosmos (CSM) https://github.com/Cosmos-CSM/csm_foundation_core diff --git a/CSM Foundation Core/Errors/Abstractions/Bases/ErrorBase.cs b/CSM Foundation Core/Errors/Abstractions/Bases/ErrorBase.cs index 736b8c8..7e149ac 100644 --- a/CSM Foundation Core/Errors/Abstractions/Bases/ErrorBase.cs +++ b/CSM Foundation Core/Errors/Abstractions/Bases/ErrorBase.cs @@ -17,6 +17,8 @@ public abstract class ErrorBase public TEvent Event { get; init; } + public object EventCode { get => Convert.ToInt32(Event); } + public Exception? Exception { get; init; } public ErrorFeedback[] Feedback { get; init; } diff --git a/CSM Foundation Core/Errors/Abstractions/Interfaces/IError.cs b/CSM Foundation Core/Errors/Abstractions/Interfaces/IError.cs index 6ea3196..3975b27 100644 --- a/CSM Foundation Core/Errors/Abstractions/Interfaces/IError.cs +++ b/CSM Foundation Core/Errors/Abstractions/Interfaces/IError.cs @@ -14,6 +14,11 @@ public interface IError { /// string Message { get; } + /// + /// Generic event object value. + /// + public object EventCode { get; } + /// /// Exception stacking trace. /// @@ -51,8 +56,5 @@ public interface IException : IError where TEvent : Enum { - /// - /// Exception trigger event. - /// TEvent Event { get; } } \ No newline at end of file From c8efb322685abffddb57fa9e21dfd885c74fa9ae Mon Sep 17 00:00:00 2001 From: Juan Renato Urrea Ortiz Date: Sun, 29 Mar 2026 09:27:13 -0700 Subject: [PATCH 3/9] improved handling of objects --- .../Abstractions/Bases/ObjectBase.cs | 31 +++++----- CSM Foundation Core/CHANGELOG.md | 13 ++++ .../CSM Foundation Core.csproj | 3 +- .../Abstractions/Bases/ConverterBase.cs | 4 +- .../Bases/ConverterVariantBase.cs | 1 + .../ConverterBaseError.cs | 14 +++-- .../{Exceptions => Errors}/SystemError.cs | 2 +- .../Core/Extensions/DateTimeExtensions.cs | 18 +++++- .../Core/Extensions/EnumerableExtension.cs | 22 ++++++- CSM Foundation Core/Core/Utils/FileUtils.cs | 45 +++++++++++--- .../Core/Utils/GenericUtils.cs | 62 ------------------- CSM Foundation Core/Core/Utils/ObjectUtils.cs | 36 +++++++++++ CSM Foundation Core/Core/Utils/RandomUtils.cs | 26 +++++--- .../Errors/Abstractions/Bases/ErrorBase.cs | 10 ++- .../Errors/Abstractions/Interfaces/IError.cs | 1 + 15 files changed, 183 insertions(+), 105 deletions(-) rename CSM Foundation Core/Core/{Exceptions => Errors}/ConverterBaseError.cs (80%) rename CSM Foundation Core/Core/{Exceptions => Errors}/SystemError.cs (96%) delete mode 100644 CSM Foundation Core/Core/Utils/GenericUtils.cs create mode 100644 CSM Foundation Core/Core/Utils/ObjectUtils.cs diff --git a/CSM Foundation Core/Abstractions/Bases/ObjectBase.cs b/CSM Foundation Core/Abstractions/Bases/ObjectBase.cs index 8bd02c9..a3563f8 100644 --- a/CSM Foundation Core/Abstractions/Bases/ObjectBase.cs +++ b/CSM Foundation Core/Abstractions/Bases/ObjectBase.cs @@ -2,14 +2,19 @@ using System.Text.Json; using System.Text.Json.Serialization; +using CSM_Foundation_Core.Core.Utils; + namespace CSM_Foundation_Core.Abstractions.Bases; /// /// Represents an inheritance link between datasource objects /// that need specific equality comparisson between their properties. /// -public abstract class ObjectBase { +public abstract class ObjectBase + : object + where TObject : ObjectBase { + /// public override bool Equals(object? comparer) { PropertyInfo[] exceptions = []; @@ -77,7 +82,7 @@ public override bool Equals(object? comparer) { return true; } - + /// public override string ToString() { Dictionary jsonReference = []; PropertyInfo[] propReferences = GetType().GetProperties(); @@ -93,6 +98,8 @@ public override string ToString() { } ); } + + /// public override int GetHashCode() { return base.GetHashCode(); } @@ -106,7 +113,7 @@ public override int GetHashCode() { /// /// Property reflected info. /// - /// + /// /// If the Property wasn't find. /// public PropertyInfo GetProperty(string name) { @@ -118,17 +125,13 @@ PropertyInfo tracedProperty return tracedProperty; } + /// + /// Clones the current object into a new instance with the same property values. + /// + /// + /// Cloned instance. + /// public TObject Clone() { - Type ObjectType = typeof(TObject); - - TObject? Cloned = (TObject?)Activator.CreateInstance(ObjectType) - ?? throw new Exception("PENDING WRONG ACTIVATION"); - PropertyInfo[] ObjectPropertiesInfo = ObjectType.GetProperties(); - foreach (PropertyInfo PropertyInfo in ObjectPropertiesInfo) { - object? OriginalValue = PropertyInfo.GetValue(this); - PropertyInfo.SetValue(Cloned, OriginalValue); - } - - return Cloned.GetHashCode() == GetHashCode() ? throw new Exception("PEDNING SAME HASH") : Cloned; + return ObjectUtils.Clone((TObject)this); } } diff --git a/CSM Foundation Core/CHANGELOG.md b/CSM Foundation Core/CHANGELOG.md index e39a03f..7fbde0e 100644 --- a/CSM Foundation Core/CHANGELOG.md +++ b/CSM Foundation Core/CHANGELOG.md @@ -1,5 +1,18 @@ # CSM Foundation Core CHANGELOG +## [4.0.0-rc.1] - 29.3-2026 + +### Remved + +- Removed [GenericUtils] class cause i only had a method for object clonation, replaced and moved to [ObjectUtils] with the method [Clone]. +- Added new Error concepts and better error handling for some features that weren´t being handled correclty. + +#### Dependencies + +| Package | Previous Version | New Version | +|:----------------------------------------|:----------------:|:---------------:| +| | | | + ## [3.0.0] - 25.12-2025 ### Remved diff --git a/CSM Foundation Core/CSM Foundation Core.csproj b/CSM Foundation Core/CSM Foundation Core.csproj index 7456938..182ec74 100644 --- a/CSM Foundation Core/CSM Foundation Core.csproj +++ b/CSM Foundation Core/CSM Foundation Core.csproj @@ -4,7 +4,7 @@ net8.0 CSM_Foundation_Core CSM.Foundation.Core - 3.0.1 + 4.0.0-rc.1 Renato Urrea Cosmos (CSM) https://github.com/Cosmos-CSM/csm_foundation_core @@ -12,6 +12,7 @@ enable true CHANGELOG.md + true diff --git a/CSM Foundation Core/Convertion/Abstractions/Bases/ConverterBase.cs b/CSM Foundation Core/Convertion/Abstractions/Bases/ConverterBase.cs index 55ecdbf..98a7ead 100644 --- a/CSM Foundation Core/Convertion/Abstractions/Bases/ConverterBase.cs +++ b/CSM Foundation Core/Convertion/Abstractions/Bases/ConverterBase.cs @@ -2,7 +2,7 @@ using System.Text.Json.Serialization; using CSM_Foundation_Core.Convertion.Abstractions.Interfaces; -using CSM_Foundation_Core.Core.Exceptions; +using CSM_Foundation_Core.Core.Errors; namespace CSM_Foundation_Core.Convertion.Abstractions.Bases; @@ -54,6 +54,7 @@ [.. wrongTypes] } } + /// public override TBase? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { JsonDocument document = JsonDocument.ParseValue(ref reader); JsonElement element = document.RootElement; @@ -83,6 +84,7 @@ [.. wrongTypes] ); } + /// public override void Write(Utf8JsonWriter writer, TBase value, JsonSerializerOptions options) { foreach (Type variation in Variants) { diff --git a/CSM Foundation Core/Convertion/Abstractions/Bases/ConverterVariantBase.cs b/CSM Foundation Core/Convertion/Abstractions/Bases/ConverterVariantBase.cs index e74ae19..5c20db0 100644 --- a/CSM Foundation Core/Convertion/Abstractions/Bases/ConverterVariantBase.cs +++ b/CSM Foundation Core/Convertion/Abstractions/Bases/ConverterVariantBase.cs @@ -6,6 +6,7 @@ namespace CSM_Foundation_Core.Convertion.Abstractions.Bases; public abstract class ConverterVariantBase : IConverterVariant { + /// public string Discriminator { get; init; } /// diff --git a/CSM Foundation Core/Core/Exceptions/ConverterBaseError.cs b/CSM Foundation Core/Core/Errors/ConverterBaseError.cs similarity index 80% rename from CSM Foundation Core/Core/Exceptions/ConverterBaseError.cs rename to CSM Foundation Core/Core/Errors/ConverterBaseError.cs index 6991d1e..747db29 100644 --- a/CSM Foundation Core/Core/Exceptions/ConverterBaseError.cs +++ b/CSM Foundation Core/Core/Errors/ConverterBaseError.cs @@ -2,7 +2,7 @@ using CSM_Foundation_Core.Convertion.Abstractions.Interfaces; using CSM_Foundation_Core.Errors.Abstractions.Bases; -namespace CSM_Foundation_Core.Core.Exceptions; +namespace CSM_Foundation_Core.Core.Errors; /// /// Exception situations enumerator. @@ -34,15 +34,17 @@ public class ConverterBaseError /// /// Creates a new instance. /// - /// - /// Exception situation. + /// + /// Error event. + /// + /// + /// Wrong variations found. /// - /// /// /// Discriminator when the variation convertion fails. /// - public ConverterBaseError(ConverterBaseErrorEvents situation, Type[]? wrongVariations = null, string discriminator = "") - : base("CSM Converter Exception", situation) { + public ConverterBaseError(ConverterBaseErrorEvents @event, Type[]? wrongVariations = null, string discriminator = "") + : base("CSM Converter Exception", @event) { wrongVariations ??= []; Data = new Dictionary { diff --git a/CSM Foundation Core/Core/Exceptions/SystemError.cs b/CSM Foundation Core/Core/Errors/SystemError.cs similarity index 96% rename from CSM Foundation Core/Core/Exceptions/SystemError.cs rename to CSM Foundation Core/Core/Errors/SystemError.cs index 208b925..87ef5d4 100644 --- a/CSM Foundation Core/Core/Exceptions/SystemError.cs +++ b/CSM Foundation Core/Core/Errors/SystemError.cs @@ -1,7 +1,7 @@ using CSM_Foundation_Core.Errors.Abstractions.Bases; using CSM_Foundation_Core.Errors.Models; -namespace CSM_Foundation_Core.Core.Exceptions; +namespace CSM_Foundation_Core.Core.Errors; /// diff --git a/CSM Foundation Core/Core/Extensions/DateTimeExtensions.cs b/CSM Foundation Core/Core/Extensions/DateTimeExtensions.cs index 51c05de..99d72f1 100644 --- a/CSM Foundation Core/Core/Extensions/DateTimeExtensions.cs +++ b/CSM Foundation Core/Core/Extensions/DateTimeExtensions.cs @@ -1,8 +1,22 @@ namespace CSM_Foundation_Core.Core.Extensions; + + +/// +/// Extends class. +/// public static class DateTimeExtensions { - public static DateTime Trim(this DateTime Current) { - return new DateTime(Current.Year, Current.Month, Current.Day, Current.Hour, Current.Minute, Current.Second); + /// + /// Trims the given to seconds. + /// + /// + /// Current object. + /// + /// + /// Trimmed to seconds. + /// + public static DateTime Trim(this DateTime obj) { + return new DateTime(obj.Year, obj.Month, obj.Day, obj.Hour, obj.Minute, obj.Second); } } diff --git a/CSM Foundation Core/Core/Extensions/EnumerableExtension.cs b/CSM Foundation Core/Core/Extensions/EnumerableExtension.cs index 8f7889a..224dc4a 100644 --- a/CSM Foundation Core/Core/Extensions/EnumerableExtension.cs +++ b/CSM Foundation Core/Core/Extensions/EnumerableExtension.cs @@ -1,6 +1,24 @@ namespace CSM_Foundation_Core.Core.Extensions; + + +/// +/// Extends class. +/// public static class EnumerableExtension { - public static bool Empty(this IEnumerable List) { - return !List.Any(); + + /// + /// Checks if the is empty. + /// + /// + /// Type of the content. + /// + /// + /// Current object. + /// + /// + /// Whether the collection is empty or not. + /// + public static bool Empty(this IEnumerable obj) { + return !obj.Any(); } } diff --git a/CSM Foundation Core/Core/Utils/FileUtils.cs b/CSM Foundation Core/Core/Utils/FileUtils.cs index 8c454eb..d1b91e5 100644 --- a/CSM Foundation Core/Core/Utils/FileUtils.cs +++ b/CSM Foundation Core/Core/Utils/FileUtils.cs @@ -1,21 +1,52 @@ using System.Text.Json; namespace CSM_Foundation_Core.Core.Utils; + + +/// +/// Provide system files utility methods. +/// public class FileUtils { - public static string FormatLocation(string Location) { + + /// + /// Formats the given for system sensitive '/' or '\\' usage. + /// + /// + /// System file path. + /// + /// + /// Formatted system file path. + /// + public static string FormatPath(string path) { string wd = Directory.GetCurrentDirectory(); if (wd.Contains('/')) { - Location = Location.Replace("\\", "/"); + path = path.Replace("\\", "/"); } - return Location; + return path; } - public static TModel Deserealize(string Location) { - if (!File.Exists(Location)) { - throw new FileNotFoundException(Location); + + /// + /// Gets the given file content as an instance. + /// + /// + /// Type of the converted data model. + /// + /// + /// File system path. + /// + /// + /// Converted file content into a instance. + /// + /// + /// Thrown when the given does not exist. + /// + public static TModel Deserealize(string path) { + if (!File.Exists(path)) { + throw new FileNotFoundException(path); } - Stream fs = File.OpenRead(Location); + Stream fs = File.OpenRead(path); TModel m = JsonSerializer.Deserialize(fs)!; return m; } diff --git a/CSM Foundation Core/Core/Utils/GenericUtils.cs b/CSM Foundation Core/Core/Utils/GenericUtils.cs deleted file mode 100644 index c1141ee..0000000 --- a/CSM Foundation Core/Core/Utils/GenericUtils.cs +++ /dev/null @@ -1,62 +0,0 @@ - -using System.Collections; -using System.Reflection; - -namespace CSM_Foundation_Core.Core.Utils; -public static class GenericUtils { - public static TObject DeepCopy(this TObject target, bool isParentProperty = true, Dictionary? visited = null) { - visited ??= []; - - if (target == null) - return default!; - - Type ObjectType = isParentProperty ? typeof(TObject) : target.GetType(); - - if (visited.TryGetValue(target, out var existingClone)) - return (TObject)existingClone; - - TObject Cloned = (TObject?)Activator.CreateInstance(ObjectType) - ?? throw new Exception("PENDING WRONG ACTIVATION"); - - visited[target] = Cloned; - - PropertyInfo[] ObjectPropertiesInfo = ObjectType.GetProperties(); - foreach (PropertyInfo PropertyInfo in ObjectPropertiesInfo) { - if (!PropertyInfo.CanRead || !PropertyInfo.CanWrite || PropertyInfo.GetIndexParameters().Length > 0) - continue; - - object? OriginalValue = PropertyInfo.GetValue(target); - if (OriginalValue == null) { - PropertyInfo.SetValue(Cloned, null); - } else if (PropertyInfo.PropertyType.IsValueType || PropertyInfo.PropertyType == typeof(string)) { - PropertyInfo.SetValue(Cloned, OriginalValue); - } else if (typeof(IEnumerable).IsAssignableFrom(PropertyInfo.PropertyType)) { - var clonedCollection = CloneCollection((IEnumerable)OriginalValue, PropertyInfo.PropertyType, visited); - PropertyInfo.SetValue(Cloned, clonedCollection); - } else { - var clonedValue = OriginalValue.DeepCopy(false, visited); - PropertyInfo.SetValue(Cloned, clonedValue); - } - } - - return Cloned.GetHashCode() == target!.GetHashCode() - ? throw new Exception("Clonation Error:\n SAME HASH ON:" + target.GetType()) - : Cloned; - } - - private static object CloneCollection(IEnumerable originalCollection, Type collectionType, Dictionary visited) { - Type elementType = collectionType.IsGenericType - ? collectionType.GetGenericArguments()[0] - : typeof(object); - - var clonedCollection = (IList?)Activator.CreateInstance(typeof(List<>).MakeGenericType(elementType)); - if (clonedCollection == null) return originalCollection; - - foreach (var item in originalCollection) { - var clonedItem = item.DeepCopy(false, visited); - clonedCollection.Add(clonedItem); - } - - return clonedCollection; - } -} diff --git a/CSM Foundation Core/Core/Utils/ObjectUtils.cs b/CSM Foundation Core/Core/Utils/ObjectUtils.cs new file mode 100644 index 0000000..5c75905 --- /dev/null +++ b/CSM Foundation Core/Core/Utils/ObjectUtils.cs @@ -0,0 +1,36 @@ +using System.Reflection; + +namespace CSM_Foundation_Core.Core.Utils; + + +/// +/// Provides utlity methods for objects handling. +/// +public static class ObjectUtils { + + /// + /// Clones the current object into a new instance with the same property values. + /// + /// + /// Object reference to be cloned. + /// + /// + /// Cloned instance. + /// + public static TObject Clone(TObject obj) { + if(obj is null) + return obj; + + Type objType = typeof(TObject); + + TObject? Cloned = (TObject?)Activator.CreateInstance(objType) + ?? throw new Exception("PENDING WRONG ACTIVATION"); + PropertyInfo[] ObjectPropertiesInfo = objType.GetProperties(); + foreach (PropertyInfo PropertyInfo in ObjectPropertiesInfo) { + object? OriginalValue = PropertyInfo.GetValue(obj); + PropertyInfo.SetValue(Cloned, OriginalValue); + } + + return Cloned.GetHashCode() == obj?.GetHashCode() ? throw new Exception("Same hash detected along clonation, fatal error.") : Cloned; + } +} diff --git a/CSM Foundation Core/Core/Utils/RandomUtils.cs b/CSM Foundation Core/Core/Utils/RandomUtils.cs index 5f7279e..27fda8c 100644 --- a/CSM Foundation Core/Core/Utils/RandomUtils.cs +++ b/CSM Foundation Core/Core/Utils/RandomUtils.cs @@ -1,15 +1,27 @@ namespace CSM_Foundation_Core.Core.Utils; + +/// +/// Provide randomization utility methods. +/// public static class RandomUtils { private static readonly Random Randomizer = new(); - public static string String(int Size) { - char[] letters = new char[Size]; - for (int Pointing = 0; Pointing < Size; Pointing++) { - int Code = Randomizer.Next(65, 91); - letters[Pointing] = (char)Code; + /// + /// Gets a randomized string. + /// + /// + /// String size + /// + /// + /// A randomized string. + /// + public static string String(int size) { + char[] letters = new char[size]; + for (int i = 0; i < size; i++) { + int code = Randomizer.Next(65, 91); + letters[i] = (char)code; } - string GeneratedString = new(letters); - return GeneratedString; + return new string(letters); } } diff --git a/CSM Foundation Core/Errors/Abstractions/Bases/ErrorBase.cs b/CSM Foundation Core/Errors/Abstractions/Bases/ErrorBase.cs index 7e149ac..26784c5 100644 --- a/CSM Foundation Core/Errors/Abstractions/Bases/ErrorBase.cs +++ b/CSM Foundation Core/Errors/Abstractions/Bases/ErrorBase.cs @@ -13,23 +13,29 @@ public abstract class ErrorBase : Exception, IException where TEvent : Enum { + /// public string Advise { get; init; } + /// public TEvent Event { get; init; } + /// public object EventCode { get => Convert.ToInt32(Event); } + /// public Exception? Exception { get; init; } + /// public ErrorFeedback[] Feedback { get; init; } + /// public new IDictionary Data { get; init; } /// /// Creates a new instance. /// - /// - /// Exception subject. + /// + /// Error message. /// /// /// Exception trigger event. diff --git a/CSM Foundation Core/Errors/Abstractions/Interfaces/IError.cs b/CSM Foundation Core/Errors/Abstractions/Interfaces/IError.cs index 3975b27..92e3b09 100644 --- a/CSM Foundation Core/Errors/Abstractions/Interfaces/IError.cs +++ b/CSM Foundation Core/Errors/Abstractions/Interfaces/IError.cs @@ -56,5 +56,6 @@ public interface IException : IError where TEvent : Enum { + /// TEvent Event { get; } } \ No newline at end of file From b5be19e7550bbb47c93cb70edde1fa96c7946f3c Mon Sep 17 00:00:00 2001 From: Juan Renato Urrea Ortiz Date: Wed, 1 Apr 2026 13:48:59 -0700 Subject: [PATCH 4/9] added object abstraction base --- .../Abstractions/Bases/ObjectBase.cs | 33 +++++++++++-------- CSM Foundation Core/CHANGELOG.md | 3 +- .../CSM Foundation Core.csproj | 2 +- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/CSM Foundation Core/Abstractions/Bases/ObjectBase.cs b/CSM Foundation Core/Abstractions/Bases/ObjectBase.cs index a3563f8..2a5e955 100644 --- a/CSM Foundation Core/Abstractions/Bases/ObjectBase.cs +++ b/CSM Foundation Core/Abstractions/Bases/ObjectBase.cs @@ -6,13 +6,30 @@ namespace CSM_Foundation_Core.Abstractions.Bases; +/// +/// +/// Object implementation type. +/// +public abstract class ObjectBase + : object + where TObject : ObjectBase { + + /// + /// Clones the current object into a new instance with the same property values. + /// + /// + /// Cloned instance. + /// + public TObject Clone() { + return ObjectUtils.Clone((TObject)this); + } +} + /// /// Represents an inheritance link between datasource objects /// that need specific equality comparisson between their properties. /// -public abstract class ObjectBase - : object - where TObject : ObjectBase { +public class ObjectBase { /// public override bool Equals(object? comparer) { @@ -124,14 +141,4 @@ PropertyInfo tracedProperty return tracedProperty; } - - /// - /// Clones the current object into a new instance with the same property values. - /// - /// - /// Cloned instance. - /// - public TObject Clone() { - return ObjectUtils.Clone((TObject)this); - } } diff --git a/CSM Foundation Core/CHANGELOG.md b/CSM Foundation Core/CHANGELOG.md index 7fbde0e..3e3add0 100644 --- a/CSM Foundation Core/CHANGELOG.md +++ b/CSM Foundation Core/CHANGELOG.md @@ -1,11 +1,12 @@ # CSM Foundation Core CHANGELOG -## [4.0.0-rc.1] - 29.3-2026 +## [4.0.0-rc.2] - 29.3-2026 ### Remved - Removed [GenericUtils] class cause i only had a method for object clonation, replaced and moved to [ObjectUtils] with the method [Clone]. - Added new Error concepts and better error handling for some features that weren´t being handled correclty. +- Added a simplified [ObjectBase] abstraction for non used generic methods. #### Dependencies diff --git a/CSM Foundation Core/CSM Foundation Core.csproj b/CSM Foundation Core/CSM Foundation Core.csproj index 182ec74..e4bbb89 100644 --- a/CSM Foundation Core/CSM Foundation Core.csproj +++ b/CSM Foundation Core/CSM Foundation Core.csproj @@ -4,7 +4,7 @@ net8.0 CSM_Foundation_Core CSM.Foundation.Core - 4.0.0-rc.1 + 4.0.0-rc.2 Renato Urrea Cosmos (CSM) https://github.com/Cosmos-CSM/csm_foundation_core From bb656d66e63082f7e3bd792584de4bd1ae817e42 Mon Sep 17 00:00:00 2001 From: Juan Renato Urrea Ortiz Date: Wed, 1 Apr 2026 14:53:17 -0700 Subject: [PATCH 5/9] removed --- .../Abstractions/Bases/ObjectBase.cs | 21 ------------------- CSM Foundation Core/CHANGELOG.md | 3 ++- .../CSM Foundation Core.csproj | 2 +- 3 files changed, 3 insertions(+), 23 deletions(-) diff --git a/CSM Foundation Core/Abstractions/Bases/ObjectBase.cs b/CSM Foundation Core/Abstractions/Bases/ObjectBase.cs index 2a5e955..2635ed1 100644 --- a/CSM Foundation Core/Abstractions/Bases/ObjectBase.cs +++ b/CSM Foundation Core/Abstractions/Bases/ObjectBase.cs @@ -2,29 +2,8 @@ using System.Text.Json; using System.Text.Json.Serialization; -using CSM_Foundation_Core.Core.Utils; - namespace CSM_Foundation_Core.Abstractions.Bases; -/// -/// -/// Object implementation type. -/// -public abstract class ObjectBase - : object - where TObject : ObjectBase { - - /// - /// Clones the current object into a new instance with the same property values. - /// - /// - /// Cloned instance. - /// - public TObject Clone() { - return ObjectUtils.Clone((TObject)this); - } -} - /// /// Represents an inheritance link between datasource objects /// that need specific equality comparisson between their properties. diff --git a/CSM Foundation Core/CHANGELOG.md b/CSM Foundation Core/CHANGELOG.md index 3e3add0..feb533c 100644 --- a/CSM Foundation Core/CHANGELOG.md +++ b/CSM Foundation Core/CHANGELOG.md @@ -1,12 +1,13 @@ # CSM Foundation Core CHANGELOG -## [4.0.0-rc.2] - 29.3-2026 +## [4.0.0-rc.3] - 29.3-2026 ### Remved - Removed [GenericUtils] class cause i only had a method for object clonation, replaced and moved to [ObjectUtils] with the method [Clone]. - Added new Error concepts and better error handling for some features that weren´t being handled correclty. - Added a simplified [ObjectBase] abstraction for non used generic methods. +- Removed [ObjectBase{TEntity}] cause an utility method was created. #### Dependencies diff --git a/CSM Foundation Core/CSM Foundation Core.csproj b/CSM Foundation Core/CSM Foundation Core.csproj index e4bbb89..1e58344 100644 --- a/CSM Foundation Core/CSM Foundation Core.csproj +++ b/CSM Foundation Core/CSM Foundation Core.csproj @@ -4,7 +4,7 @@ net8.0 CSM_Foundation_Core CSM.Foundation.Core - 4.0.0-rc.2 + 4.0.0-rc.3 Renato Urrea Cosmos (CSM) https://github.com/Cosmos-CSM/csm_foundation_core From a8310fc338048eb7e9b2eb6ca3d8f6802f7fcc22 Mon Sep 17 00:00:00 2001 From: Juan Renato Urrea Ortiz Date: Tue, 19 May 2026 03:41:58 -0700 Subject: [PATCH 6/9] released v4.0.0 --- CSM Foundation Core/CHANGELOG.md | 5 ++++- CSM Foundation Core/CSM Foundation Core.csproj | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CSM Foundation Core/CHANGELOG.md b/CSM Foundation Core/CHANGELOG.md index feb533c..a6d3e99 100644 --- a/CSM Foundation Core/CHANGELOG.md +++ b/CSM Foundation Core/CHANGELOG.md @@ -1,12 +1,15 @@ # CSM Foundation Core CHANGELOG -## [4.0.0-rc.3] - 29.3-2026 +## [4.0.0] - 19.05-2026 ### Remved - Removed [GenericUtils] class cause i only had a method for object clonation, replaced and moved to [ObjectUtils] with the method [Clone]. + - Added new Error concepts and better error handling for some features that weren´t being handled correclty. + - Added a simplified [ObjectBase] abstraction for non used generic methods. + - Removed [ObjectBase{TEntity}] cause an utility method was created. #### Dependencies diff --git a/CSM Foundation Core/CSM Foundation Core.csproj b/CSM Foundation Core/CSM Foundation Core.csproj index 1e58344..7cb5de5 100644 --- a/CSM Foundation Core/CSM Foundation Core.csproj +++ b/CSM Foundation Core/CSM Foundation Core.csproj @@ -4,7 +4,7 @@ net8.0 CSM_Foundation_Core CSM.Foundation.Core - 4.0.0-rc.3 + 4.0.0 Renato Urrea Cosmos (CSM) https://github.com/Cosmos-CSM/csm_foundation_core From 6f96a0856a536659a37b21de8571f87a85058a4b Mon Sep 17 00:00:00 2001 From: jr110 Date: Fri, 25 Sep 2026 16:31:09 -0700 Subject: [PATCH 7/9] Added [ResourceType] enum --- CSM Foundation Core/CHANGELOG.md | 15 ++++++++++++++- .../Core/Resources/ResourceType.cs | 16 ++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 CSM Foundation Core/Core/Resources/ResourceType.cs diff --git a/CSM Foundation Core/CHANGELOG.md b/CSM Foundation Core/CHANGELOG.md index a6d3e99..e808ba5 100644 --- a/CSM Foundation Core/CHANGELOG.md +++ b/CSM Foundation Core/CHANGELOG.md @@ -1,8 +1,21 @@ # CSM Foundation Core CHANGELOG + +## [x.x.x] - xx.xx-xxxx + +### Added + +- Added [ResourceType] enum to handle the resource types in CSM systems. + +#### Dependencies + +| Package | Previous Version | New Version | +|:----------------------------------------|:----------------:|:---------------:| +| | | | + ## [4.0.0] - 19.05-2026 -### Remved +### Removed - Removed [GenericUtils] class cause i only had a method for object clonation, replaced and moved to [ObjectUtils] with the method [Clone]. diff --git a/CSM Foundation Core/Core/Resources/ResourceType.cs b/CSM Foundation Core/Core/Resources/ResourceType.cs new file mode 100644 index 0000000..2f4bef3 --- /dev/null +++ b/CSM Foundation Core/Core/Resources/ResourceType.cs @@ -0,0 +1,16 @@ +namespace CSM_Foundation_Core.Core.Resources; + +/// +/// Resources types enumerator. +/// +public enum ResourceType { + /// + /// When the resource has a remote access Link. + /// + HLINK, + + /// + /// When the resource has local or network access data. + /// + FILE +} From 32ed6531d4133a63f5e963094ea58e9e56f14bff Mon Sep 17 00:00:00 2001 From: jr110 Date: Fri, 25 Sep 2026 21:44:27 -0700 Subject: [PATCH 8/9] adding [ScalarValue] enumerator --- CSM Foundation Core/CHANGELOG.md | 1 + .../Core/Resources/ResourceType.cs | 2 +- .../Core/Resources/ScalarValue.cs | 31 +++++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 CSM Foundation Core/Core/Resources/ScalarValue.cs diff --git a/CSM Foundation Core/CHANGELOG.md b/CSM Foundation Core/CHANGELOG.md index e808ba5..26e3ad9 100644 --- a/CSM Foundation Core/CHANGELOG.md +++ b/CSM Foundation Core/CHANGELOG.md @@ -6,6 +6,7 @@ ### Added - Added [ResourceType] enum to handle the resource types in CSM systems. +- Added [ScalarValue] enum to handle the scalar value types in CSM systems. #### Dependencies diff --git a/CSM Foundation Core/Core/Resources/ResourceType.cs b/CSM Foundation Core/Core/Resources/ResourceType.cs index 2f4bef3..f1b5dea 100644 --- a/CSM Foundation Core/Core/Resources/ResourceType.cs +++ b/CSM Foundation Core/Core/Resources/ResourceType.cs @@ -12,5 +12,5 @@ public enum ResourceType { /// /// When the resource has local or network access data. /// - FILE + FILE, } diff --git a/CSM Foundation Core/Core/Resources/ScalarValue.cs b/CSM Foundation Core/Core/Resources/ScalarValue.cs new file mode 100644 index 0000000..7f8feb1 --- /dev/null +++ b/CSM Foundation Core/Core/Resources/ScalarValue.cs @@ -0,0 +1,31 @@ +namespace CSM_Foundation_Core.Core.Resources; + +/// +/// Scalar values enumerator. +/// +public enum ScalarValue { + /// + /// Double precision floating point number. + /// + DOUBLE, + + /// + /// Integer number. + /// + INT, + + /// + /// String value. + /// + STRING, + + /// + /// Boolean value. + /// + BOOL, + + /// + /// Enumeration value. + /// + ENUM, +} From ab138f4fdbef0956474b10ff000792954677a93c Mon Sep 17 00:00:00 2001 From: Renato Urrea Date: Mon, 28 Sep 2026 20:43:11 -0700 Subject: [PATCH 9/9] Fix summary comment for ResourceType enumeration Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- CSM Foundation Core/Core/Resources/ResourceType.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CSM Foundation Core/Core/Resources/ResourceType.cs b/CSM Foundation Core/Core/Resources/ResourceType.cs index f1b5dea..2eaac44 100644 --- a/CSM Foundation Core/Core/Resources/ResourceType.cs +++ b/CSM Foundation Core/Core/Resources/ResourceType.cs @@ -1,7 +1,7 @@ namespace CSM_Foundation_Core.Core.Resources; /// -/// Resources types enumerator. +/// Resource types enumeration. /// public enum ResourceType { ///