Skip to content

Commit

Permalink
feat: add ConfigureServices overload with IApplicationContext
Browse files Browse the repository at this point in the history
  • Loading branch information
SonicGD committed Jan 31, 2024
1 parent b8d6457 commit 5b8645c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Sitko.Core.App/ISitkoCoreApplicationBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Serilog;
using Serilog.Events;

Expand Down Expand Up @@ -28,4 +29,5 @@ ISitkoCoreApplicationBuilder ConfigureLogging(
Func<IApplicationContext, LoggerConfiguration, LoggerConfiguration> configure);

ISitkoCoreApplicationBuilder ConfigureServices(Action<IServiceCollection> configure);
ISitkoCoreApplicationBuilder ConfigureServices(Action<IApplicationContext, IServiceCollection> configure);
}
6 changes: 6 additions & 0 deletions src/Sitko.Core.App/SitkoCoreBaseApplicationBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ public ISitkoCoreApplicationBuilder ConfigureLogging(
return this;
}

public ISitkoCoreApplicationBuilder ConfigureServices(Action<IApplicationContext, IServiceCollection> configure)
{
configure(bootApplicationContext!, Services);
return this;
}

public ISitkoCoreApplicationBuilder ConfigureServices(Action<IServiceCollection> configure)
{
configure(Services);
Expand Down

0 comments on commit 5b8645c

Please sign in to comment.