public async Task Handle(EmpleadoDeleteCommand notification, CancellationToken cancellationToken) { var empleado = await _context.Empleados.SingleAsync(x => x.Id == notification.Id, cancellationToken); _context.Remove(empleado); await _context.SaveChangesAsync(cancellationToken); }
public async Task DeleteAsync(EmpleadoDeleteCommand command) { var request = await _httpClient.DeleteAsync($"{_apiUrls.PersonalUrl}empleados/{command.Id}"); request.EnsureSuccessStatusCode(); }
public async Task <IActionResult> Delete(EmpleadoDeleteCommand notification) { await _personalProxy.DeleteAsync(notification); return(Ok()); }
public async Task <IActionResult> Delete(EmpleadoDeleteCommand notification) { await _mediator.Publish(notification); return(Ok()); }