Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

ImportController.cs 793B

12345678910111213141516171819202122232425
  1. using Microsoft.AspNetCore.Mvc;
  2. namespace Diligent.WebAPI.Host.Controllers.V1
  3. {
  4. [ApiVersion("1.0")]
  5. [Route("v{version:apiVersion}/import")]
  6. [ApiController]
  7. public class ImportController : ControllerBase
  8. {
  9. private readonly IImportService _service;
  10. private readonly IApplicantService _applicantService;
  11. public ImportController(IImportService service, IApplicantService applicantService)
  12. {
  13. _service = service;
  14. _applicantService = applicantService;
  15. }
  16. [HttpPost]
  17. public async Task<ActionResult> Import(IFormFile file)
  18. {
  19. var applicants = await _service.Import(file);
  20. await _applicantService.ImportApplicant(applicants);
  21. return Ok();
  22. }
  23. }
  24. }