-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: simplify dependency injection setup
The Application.cs configuration file is simplified, separating it into different files for the different entities of the application
- Loading branch information
1 parent
f5ff6a2
commit a2390b8
Showing
11 changed files
with
337 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
src/Armory.Api/Extensions/DependencyInjection/Armament/ArmamentApplication.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
using Armory.Armament.Ammunition.Application.CheckExists; | ||
using Armory.Armament.Ammunition.Application.Create; | ||
using Armory.Armament.Ammunition.Application.Find; | ||
using Armory.Armament.Ammunition.Application.SearchAll; | ||
using Armory.Armament.Ammunition.Application.SearchAllByFlight; | ||
using Armory.Armament.Equipments.Application.CheckExists; | ||
using Armory.Armament.Equipments.Application.Create; | ||
using Armory.Armament.Equipments.Application.Find; | ||
using Armory.Armament.Equipments.Application.SearchAll; | ||
using Armory.Armament.Equipments.Application.SearchAllByFlight; | ||
using Armory.Armament.Equipments.Application.Update; | ||
using Armory.Armament.Explosives.Application.CheckExists; | ||
using Armory.Armament.Explosives.Application.Create; | ||
using Armory.Armament.Explosives.Application.Find; | ||
using Armory.Armament.Explosives.Application.SearchAll; | ||
using Armory.Armament.Explosives.Application.SearchAllByFlight; | ||
using Armory.Armament.Explosives.Application.Update; | ||
using Armory.Armament.Weapons.Application.AssignHolder; | ||
using Armory.Armament.Weapons.Application.CheckExists; | ||
using Armory.Armament.Weapons.Application.Create; | ||
using Armory.Armament.Weapons.Application.Find; | ||
using Armory.Armament.Weapons.Application.GenerateQR; | ||
using Armory.Armament.Weapons.Application.SearchAll; | ||
using Armory.Armament.Weapons.Application.SearchAllByFlight; | ||
using Armory.Armament.Weapons.Application.Update; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace Armory.Api.Extensions.DependencyInjection.Armament | ||
{ | ||
public static class ArmamentApplication | ||
{ | ||
public static IServiceCollection AddArmamentApplication(this IServiceCollection services) | ||
{ | ||
services.AddScoped<WeaponCreator, WeaponCreator>(); | ||
services.AddScoped<WeaponSearcher, WeaponSearcher>(); | ||
services.AddScoped<WeaponFinder, WeaponFinder>(); | ||
services.AddScoped<WeaponExistsChecker, WeaponExistsChecker>(); | ||
services.AddScoped<WeaponUpdater, WeaponUpdater>(); | ||
services.AddScoped<WeaponHolderAssigner, WeaponHolderAssigner>(); | ||
services.AddScoped<WeaponQrGenerator, WeaponQrGenerator>(); | ||
services.AddScoped<WeaponsByFlightSearcher, WeaponsByFlightSearcher>(); | ||
|
||
services.AddScoped<AmmunitionCreator, AmmunitionCreator>(); | ||
services.AddScoped<AmmunitionSearcher, AmmunitionSearcher>(); | ||
services.AddScoped<AmmunitionFinder, AmmunitionFinder>(); | ||
services.AddScoped<AmmunitionExistsChecker, AmmunitionExistsChecker>(); | ||
services.AddScoped<AmmunitionByFlightSearcher, AmmunitionByFlightSearcher>(); | ||
|
||
services.AddScoped<EquipmentCreator, EquipmentCreator>(); | ||
services.AddScoped<AllEquipmentsSearcher, AllEquipmentsSearcher>(); | ||
services.AddScoped<EquipmentFinder, EquipmentFinder>(); | ||
services.AddScoped<EquipmentExistsChecker, EquipmentExistsChecker>(); | ||
services.AddScoped<EquipmentUpdater, EquipmentUpdater>(); | ||
services.AddScoped<EquipmentsByFlightSearcher, EquipmentsByFlightSearcher>(); | ||
|
||
services.AddScoped<ExplosiveCreator, ExplosiveCreator>(); | ||
services.AddScoped<AllExplosivesSearcher, AllExplosivesSearcher>(); | ||
services.AddScoped<ExplosiveFinder, ExplosiveFinder>(); | ||
services.AddScoped<ExplosiveExistsChecker, ExplosiveExistsChecker>(); | ||
services.AddScoped<ExplosiveUpdater, ExplosiveUpdater>(); | ||
services.AddScoped<ExplosivesByFlightSearcher, ExplosivesByFlightSearcher>(); | ||
|
||
return services; | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/Armory.Api/Extensions/DependencyInjection/Degrees/DegreesApplication.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using Armory.Degrees.Application.Create; | ||
using Armory.Degrees.Application.Find; | ||
using Armory.Degrees.Application.SearchAll; | ||
using Armory.Degrees.Application.SearchAllByRank; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace Armory.Api.Extensions.DependencyInjection.Degrees | ||
{ | ||
public static class DegreesApplication | ||
{ | ||
public static IServiceCollection AddDegreesApplication(this IServiceCollection services) | ||
{ | ||
services.AddScoped<DegreeCreator, DegreeCreator>(); | ||
services.AddScoped<DegreeFinder, DegreeFinder>(); | ||
services.AddScoped<AllDegreesSearcher, AllDegreesSearcher>(); | ||
services.AddScoped<DegreesByRankSearcher, DegreesByRankSearcher>(); | ||
|
||
return services; | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/Armory.Api/Extensions/DependencyInjection/FireTeams/FireTeamsApplication.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using Armory.Fireteams.Application.CheckExists; | ||
using Armory.Fireteams.Application.Create; | ||
using Armory.Fireteams.Application.Find; | ||
using Armory.Fireteams.Application.SearchAll; | ||
using Armory.Fireteams.Application.SearchAllByFlight; | ||
using Armory.Fireteams.Application.UpdateCommander; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace Armory.Api.Extensions.DependencyInjection.FireTeams | ||
{ | ||
public static class FireTeamApplication | ||
{ | ||
public static IServiceCollection AddFireTeamsApplication(this IServiceCollection services) | ||
{ | ||
services.AddScoped<FireteamCreator, FireteamCreator>(); | ||
services.AddScoped<FireteamFinder, FireteamFinder>(); | ||
services.AddScoped<FireteamExistsChecker, FireteamExistsChecker>(); | ||
services.AddScoped<FireteamsSearcher, FireteamsSearcher>(); | ||
services.AddScoped<FireteamsByFlightSearcher, FireteamsByFlightSearcher>(); | ||
services.AddScoped<FireTeamCommanderUpdater, FireTeamCommanderUpdater>(); | ||
|
||
return services; | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/Armory.Api/Extensions/DependencyInjection/Flights/FlightsApplication.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using Armory.Flights.Application.CheckExists; | ||
using Armory.Flights.Application.Create; | ||
using Armory.Flights.Application.Find; | ||
using Armory.Flights.Application.SearchAll; | ||
using Armory.Flights.Application.UpdateCommander; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace Armory.Api.Extensions.DependencyInjection.Flights | ||
{ | ||
public static class FlightsApplication | ||
{ | ||
public static IServiceCollection AddFlightsApplication(this IServiceCollection services) | ||
{ | ||
services.AddScoped<FlightCreator, FlightCreator>(); | ||
services.AddScoped<FlightFinder, FlightFinder>(); | ||
services.AddScoped<FlightExistsChecker, FlightExistsChecker>(); | ||
services.AddScoped<FlightsSearcher, FlightsSearcher>(); | ||
services.AddScoped<FlightCommanderUpdater, FlightCommanderUpdater>(); | ||
|
||
return services; | ||
} | ||
} | ||
} |
Oops, something went wrong.