|
1 | 1 | using Ws.Database.EntityFramework;
|
2 | 2 | using Ws.PalychExchangeApi.Extensions;
|
3 |
| -using Ws.PalychExchangeApi.Features.Boxes.Common; |
4 |
| -using Ws.PalychExchangeApi.Features.Boxes.Services; |
5 |
| -using Ws.PalychExchangeApi.Features.Brands.Common; |
6 |
| -using Ws.PalychExchangeApi.Features.Brands.Services; |
7 |
| -using Ws.PalychExchangeApi.Features.Bundles.Common; |
8 |
| -using Ws.PalychExchangeApi.Features.Bundles.Services; |
9 |
| -using Ws.PalychExchangeApi.Features.Characteristics.Common; |
10 |
| -using Ws.PalychExchangeApi.Features.Characteristics.Services; |
11 |
| -using Ws.PalychExchangeApi.Features.Clips.Common; |
12 |
| -using Ws.PalychExchangeApi.Features.Clips.Services; |
13 |
| -using Ws.PalychExchangeApi.Features.Pallets.Common; |
14 |
| -using Ws.PalychExchangeApi.Features.Plus.Common; |
15 | 3 | using Ws.PalychExchangeApi.Features.Plus.Services;
|
16 |
| - |
17 | 4 | using Ws.PalychExchangeApi.Middlewares;
|
18 | 5 |
|
19 | 6 | WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
|
|
24 | 11 |
|
25 | 12 | builder.Services.AddEfCore();
|
26 | 13 |
|
| 14 | + |
| 15 | +builder.Services.Scan(scan => scan |
| 16 | + .FromAssembliesOf(typeof(PluApiService)) |
| 17 | + .AddClasses(classes => classes.Where(type => type.Name.EndsWith("ApiService"))) |
| 18 | + .AsImplementedInterfaces() |
| 19 | + .WithScopedLifetime() |
| 20 | +); |
| 21 | + |
27 | 22 | builder.Services.AddValidators();
|
28 |
| -builder.Services.AddScoped<IBoxService, BoxService>(); |
29 |
| -builder.Services.AddScoped<IClipService, ClipService>(); |
30 |
| -builder.Services.AddScoped<IBundleService, BundleService>(); |
31 |
| -builder.Services.AddScoped<IBrandService, BrandService>(); |
32 |
| -builder.Services.AddScoped<IPluService, PluService>(); |
33 |
| -builder.Services.AddScoped<ICharacteristicService, CharacteristicService>(); |
34 |
| -builder.Services.AddScoped<IPalletService, Ws.PalychExchangeApi.Features.Pallets.Services.PalletService>(); |
35 | 23 |
|
36 | 24 | #pragma warning disable CA1416
|
37 | 25 |
|
|
0 commit comments