Fix dependencies

This commit is contained in:
ngfrolov 2022-09-08 14:02:49 +05:00
parent a0ec08fac5
commit d3daef5b17
2 changed files with 2 additions and 5 deletions

View File

@ -118,8 +118,7 @@ namespace AsbCloudInfrastructure
services.AddTransient<IDailyReportService, DailyReportService>(); services.AddTransient<IDailyReportService, DailyReportService>();
services.AddTransient<IDetectedOperationService, DetectedOperationService>(); services.AddTransient<IDetectedOperationService, DetectedOperationService>();
services.AddTransient<IDrillerService, DrillerService>(); services.AddTransient<IDrillerService, DrillerService>();
services.AddTransient<IScheduleService, ScheduleService>();
services.AddTransient<IOperationValueService, OperationValueService>();
services.AddTransient<ISubsystemOperationTimeService, SubsystemOperationTimeService>(); services.AddTransient<ISubsystemOperationTimeService, SubsystemOperationTimeService>();
services.AddTransient<IScheduleRepository, ScheduleRepository>(); services.AddTransient<IScheduleRepository, ScheduleRepository>();
services.AddTransient<IRepositoryWellRelated<OperationValueDto>, CrudWellRelatedServiceBase<OperationValueDto, OperationValue>>(); services.AddTransient<IRepositoryWellRelated<OperationValueDto>, CrudWellRelatedServiceBase<OperationValueDto, OperationValue>>();
@ -140,9 +139,6 @@ namespace AsbCloudInfrastructure
s.GetService<IAsbCloudDbContext>(), s.GetService<IAsbCloudDbContext>(),
dbSet => dbSet.Include(c => c.CompanyType))); dbSet => dbSet.Include(c => c.CompanyType)));
services.AddTransient<ICrudService<CompanyTypeDto>, CrudCacheServiceBase<CompanyTypeDto, CompanyType>>(); services.AddTransient<ICrudService<CompanyTypeDto>, CrudCacheServiceBase<CompanyTypeDto, CompanyType>>();
services.AddTransient<ICrudService<ClusterDto>, CrudCacheServiceBase<ClusterDto, Cluster>>(s => services.AddTransient<ICrudService<ClusterDto>, CrudCacheServiceBase<ClusterDto, Cluster>>(s =>
new CrudCacheServiceBase<ClusterDto, Cluster>( new CrudCacheServiceBase<ClusterDto, Cluster>(

View File

@ -78,6 +78,7 @@ namespace AsbCloudWebApi.Controllers
public override async Task<ActionResult<T>> GetAsync(int id, CancellationToken token) public override async Task<ActionResult<T>> GetAsync(int id, CancellationToken token)
{ {
var actionResult = await base.GetAsync(id, token); var actionResult = await base.GetAsync(id, token);
// TODO: this can be nullref
var result = actionResult.Value; var result = actionResult.Value;
if (!await UserHasAccesToWellAsync(result.IdWell, token)) if (!await UserHasAccesToWellAsync(result.IdWell, token))
return Forbid(); return Forbid();