Added WellCompositeService in DependencyInjection

This commit is contained in:
KharchenkoVladimir 2021-10-14 12:30:51 +05:00
parent 8e447a040f
commit aa977e4db5
2 changed files with 6 additions and 5 deletions

View File

@ -40,6 +40,7 @@ namespace AsbCloudInfrastructure
services.AddTransient<IWellOperationService, WellOperationService>();
services.AddTransient<IWellOperationsStatService, WellOperationsStatService>();
services.AddTransient<IWellOperationImportService, WellOperationImportService>();
services.AddTransient<IWellCompositeService, WellCompositeService>();
services.AddTransient<IMeasureService, MeasureService>();
services.AddTransient<IDrillingProgramService, DrillingProgramService>();
services.AddTransient<IDrillingProgramApacheService, DrillingProgramApacheService>();

View File

@ -13,12 +13,12 @@ namespace AsbCloudWebApi.Controllers
[Authorize]
public class WellCompositeController : ControllerBase
{
private readonly IWellCompositeService service;
private readonly IWellCompositeService wellCompositeService;
private readonly IWellService wellService;
public WellCompositeController(IWellCompositeService service, IWellService wellService)
public WellCompositeController(IWellCompositeService wellCompositeService, IWellService wellService)
{
this.service = service;
this.wellCompositeService = wellCompositeService;
this.wellService = wellService;
}
@ -35,7 +35,7 @@ namespace AsbCloudWebApi.Controllers
if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false))
return Forbid();
var result = await service.GetAsync(idWell, token).ConfigureAwait(false);
var result = await wellCompositeService.GetAsync(idWell, token).ConfigureAwait(false);
return Ok(result);
}
@ -52,7 +52,7 @@ namespace AsbCloudWebApi.Controllers
if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false))
return Forbid();
var result = await service.SaveAsync(idWell, wellComposites, token).ConfigureAwait(false);
var result = await wellCompositeService.SaveAsync(idWell, wellComposites, token).ConfigureAwait(false);
return Ok(result);
}