Ejemplo n.º 1
0
        public async Task UpdatePilotAsync(int id, PilotUpdateDto updateDto)
        {
            var pilot = await context.Pilots.FirstOrDefaultAsync(x => x.Id == id);

            if (pilot == null)
            {
                throw new Exception($"Pilot with id: {id} not found.");
            }

            pilot = updateDto.UpdateModelObject(pilot);

            await context.SaveChangesAsync();
        }
Ejemplo n.º 2
0
 public async Task UpdatePilot(int id, [FromBody] PilotUpdateDto updateDto)
 {
     await pilotService.UpdatePilotAsync(id, updateDto);
 }
Ejemplo n.º 3
0
 public async Task UpdatePilotAsync(int id, PilotUpdateDto updateDto)
 {
     await pilotRepository.UpdatePilotAsync(id, updateDto);
 }