|
3 | 3 | using Microsoft.AspNetCore.Mvc;
|
4 | 4 | using Microsoft.AspNetCore.Mvc.Authorization;
|
5 | 5 | using Ws.Database.EntityFramework;
|
6 |
| -using Ws.Desktop.Api.App.Features.Arms.Common; |
7 | 6 | using Ws.Desktop.Api.App.Features.Arms.Impl;
|
8 |
| -using Ws.Desktop.Api.App.Features.PalletMen.Common; |
9 |
| -using Ws.Desktop.Api.App.Features.PalletMen.Impl; |
10 |
| -using Ws.Desktop.Api.App.Features.Pallets.Common; |
11 |
| -using Ws.Desktop.Api.App.Features.Pallets.Impl; |
12 |
| -using Ws.Desktop.Api.App.Features.Plu.Common; |
13 |
| -using Ws.Desktop.Api.App.Features.Plu.Impl.Piece; |
14 |
| -using Ws.Desktop.Api.App.Features.Plu.Impl.Weight; |
15 | 7 | using Ws.Desktop.Api.App.Middlewares;
|
16 | 8 | using Ws.Domain.Services;
|
17 | 9 | using Ws.Labels.Service;
|
|
22 | 14 |
|
23 | 15 | #region Internal services
|
24 | 16 |
|
25 |
| -builder.Services.AddScoped<IArmService, ArmService>(); |
26 |
| -builder.Services.AddScoped<IPluPieceService, PluPieceService>(); |
27 |
| -builder.Services.AddScoped<IPluWeightService, PluWeightService>(); |
28 |
| -builder.Services.AddScoped<IPalletManService, PalletManService>(); |
29 |
| -builder.Services.AddScoped<IPalletApiService, PalletApiService>(); |
| 17 | +builder.Services.Scan(scan => scan |
| 18 | + .FromAssembliesOf(typeof(ArmApiService)) |
| 19 | + .AddClasses(classes => classes.Where(type => type.Name.EndsWith("ApiService"))) |
| 20 | + .AsImplementedInterfaces() |
| 21 | + .WithScopedLifetime() |
| 22 | +); |
30 | 23 |
|
31 | 24 | #endregion
|
32 | 25 |
|
|
0 commit comments