~ruther/NosSmooth

e31da370527c37aee50c99f97db0fd9d780986e8 — Rutherther 2 years ago 63fccd7
fix(core): do not try to create stateful instance in case the entity is already present
M Core/NosSmooth.Core/NosSmooth.Core.csproj => Core/NosSmooth.Core/NosSmooth.Core.csproj +1 -1
@@ 6,7 6,7 @@
        <TargetFrameworks>net7.0;netstandard2.1</TargetFrameworks>
        <Authors>Rutherther</Authors>
        <Description>NosSmooth Core library allowing implementing nostale client, handling packets and commands.</Description>
        <VersionPrefix>3.4.1</VersionPrefix>
        <VersionPrefix>3.4.2</VersionPrefix>
        <PackageReleaseNotes>Fix StatefulInjector returning Func instead of the object.</PackageReleaseNotes>
    </PropertyGroup>


M Core/NosSmooth.Core/Stateful/StatefulRepository.cs => Core/NosSmooth.Core/Stateful/StatefulRepository.cs +6 -1
@@ 76,7 76,12 @@ public class StatefulRepository
            },
            (_, objectDictionary) =>
            {
                objectDictionary.TryAdd(statefulEntityType, ActivatorUtilities.CreateInstance(services, statefulEntityType));
                if (!objectDictionary.ContainsKey(statefulEntityType))
                {
                    objectDictionary.TryAdd
                        (statefulEntityType, ActivatorUtilities.CreateInstance(services, statefulEntityType));
                }

                return objectDictionary;
            }
        );

Do not follow this link