Skip to content

Commit

Permalink
added generalmodule
Browse files Browse the repository at this point in the history
fixed vulnerability (newtonsoft.json)
  • Loading branch information
joshika39 committed Oct 9, 2023
1 parent 243a8e0 commit 29c594c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
1 change: 1 addition & 0 deletions Nuget/Projects/Modules.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<dependencies>
<group targetFramework="net6.0">
<dependency id="Microsoft.Extensions.DependencyInjection" version="7.0.0" />
<dependency id="Newtonsoft.Json" version="13.0.3" />
</group>
</dependencies>
</metadata>
Expand Down
2 changes: 1 addition & 1 deletion _src/Implementation/Implementation.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@


<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />



Expand Down
8 changes: 4 additions & 4 deletions _src/Implementation/Module/CoreModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@
using Infrastructure.IO;
using Infrastructure.IO.Factories;
using Infrastructure.Logger;
using Infrastructure.Module;
using Infrastructure.Navigator.Factories;
using Infrastructure.Repositories.Factories;
using Microsoft.Extensions.DependencyInjection;

namespace Implementation.Module
{
public class CoreModule
public class CoreModule : IGeneralModule
{
public static void LoadModules(IServiceCollection collection, string projectName)
public void LoadModules(IServiceCollection collection, string projectNamespace)
{
var mainFolder = Path.Join("joshika39", projectName);
var mainFolder = Path.Join("joshika39", projectNamespace);
var userFolder = Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), mainFolder);
collection.AddScoped<ILogger, Logger.Logger>(_ => new Logger.Logger(Guid.NewGuid()));

collection.AddTransient<IIOFactory, IOFactory>();
collection.AddTransient<INavigatorFactory, NavigatorFactory>();
collection.AddTransient<INavigatorElementFactory, NavigatorElementFactory>();
Expand Down
9 changes: 9 additions & 0 deletions _src/Infrastructure/Module/IGeneralModule.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Microsoft.Extensions.DependencyInjection;

namespace Infrastructure.Module
{
public interface IGeneralModule
{
void LoadModules(IServiceCollection collection, string projectNamespace);
}
}
2 changes: 1 addition & 1 deletion _src/_Tests/ManualTests/Core.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ internal class Core
public IServiceProvider LoadModules()
{
var collection = new ServiceCollection();
CoreModule.LoadModules(collection, "ManualTests");
new CoreModule().LoadModules(collection, "ManualTests");
return collection.BuildServiceProvider();
}
}
Expand Down

0 comments on commit 29c594c

Please sign in to comment.