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;
}
);