Skip to content

Commit

Permalink
Updated development nuget(s)
Browse files Browse the repository at this point in the history
  • Loading branch information
gonace committed May 6, 2024
1 parent 8600c4b commit ccdcf23
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
8 changes: 4 additions & 4 deletions laget.Quartz.Tests/laget.Quartz.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.console" Version="2.7.0">
<PackageReference Include="xunit" Version="2.8.0" />
<PackageReference Include="xunit.runner.console" Version="2.8.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.runner.msbuild" Version="2.7.0">
<PackageReference Include="xunit.runner.msbuild" Version="2.8.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
16 changes: 12 additions & 4 deletions laget.Quartz/Utilities/Registrator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public interface IRegistrator

public class Registrator : IRegistrator
{
private readonly Dictionary<int, TypeReference> _bindings = new Dictionary<int, TypeReference>();
private readonly Dictionary<string, TypeReference> _bindings = new Dictionary<string, TypeReference>();
private readonly ContainerBuilder _builder;

public Registrator(ContainerBuilder builder)
Expand All @@ -65,7 +65,7 @@ public void Assembly(Assembly assembly)

foreach (var job in jobs)
{
_bindings.Add(job.GetHashCode(), new TypeReference(assembly, job));
_bindings.Add(GetFullname(job), new TypeReference(assembly, job));
}
}

Expand All @@ -79,7 +79,7 @@ public void Register<T>()
var type = typeof(T);
var assembly = type.GetTypeInfo().Assembly;

_bindings.Add(type.GetHashCode(), new TypeReference(assembly, type));
_bindings.Add(GetFullname(type), new TypeReference(assembly, type));
}

public void RegisterModule<TModule>() where TModule : Module, new()
Expand Down Expand Up @@ -109,7 +109,7 @@ private void Assembly(Assembly assembly, Type type)

foreach (var job in jobs)
{
_bindings.Add(job.GetHashCode(), new TypeReference(assembly, job));
_bindings.Add(GetFullname(job), new TypeReference(assembly, job));
}
}

Expand All @@ -136,5 +136,13 @@ public TypeReference(Assembly assembly, Type type)
public Assembly Assembly { get; }
public Type Type { get; }
}

private string GetFullname(Type type)
{
if (string.IsNullOrWhiteSpace(type.FullName))
return type.Name;

return type.FullName;
}
}
}

0 comments on commit ccdcf23

Please sign in to comment.