payments #94

Merged
khwezi merged 2 commits from payments into master 2026-06-09 21:53:53 +02:00
5 changed files with 18 additions and 5 deletions
Showing only changes of commit 11dfd18a44 - Show all commits
@@ -14,7 +14,7 @@ builder.Services.AddScopedFeatureManagement();
builder.Services
.AddLogging()
.AddShopServices()
.AddShopServices()
.AddHostedService<ProductsSeederService>()
.AddHostedService<CategorySeederService>()
.AddHostedService<CustomerSeederService>()
@@ -1,5 +1,7 @@
using LiteCharms.Features.Extensions;
using LiteCharms.Features.MidrandBooks.Abstractions;
using LiteCharms.Features.MidrandBooks.Extensions;
using Microsoft.VisualStudio.TestPlatform.TestHost;
namespace LiteCharms.Features.MidrandBooks.Tests.Common;
@@ -0,0 +1,3 @@
namespace LiteCharms.Features.MidrandBooks.Abstractions;
public interface IMidrandBooks;
@@ -1,18 +1,23 @@
using LiteCharms.Features.Abstractions;
using LiteCharms.Features.MidrandBooks.Abstractions;
namespace LiteCharms.Features.MidrandBooks.Extensions;
public static class Shop
{
public static IServiceCollection AddShopServices(this IServiceCollection services, Assembly assembly)
public static IServiceCollection AddShopServices(this IServiceCollection services)
{
var serviceType = typeof(IService);
var implementations = assembly.GetTypes()
var sharedImplementations = typeof(IFeatures).Assembly.GetTypes()
.Where(t => serviceType.IsAssignableFrom(t) && t.IsClass && !t.IsAbstract);
foreach (var implementation in implementations)
services.AddScoped(implementation);
foreach (var sharedImplementation in sharedImplementations) services.AddScoped(sharedImplementation);
var coreImplementations = typeof(IMidrandBooks).Assembly.GetTypes()
.Where(t => serviceType.IsAssignableFrom(t) && t.IsClass && !t.IsAbstract);
foreach (var coreImplementation in coreImplementations) services.AddScoped(coreImplementation);
return services;
}
@@ -0,0 +1,3 @@
namespace LiteCharms.Features.Abstractions;
public interface IFeatures;