public async Task <IActionResult> Confirm([FromQuery] long userId) { try { await _updateUsersService.SetUsersConfirmedAsync(new List <long> { userId }).ConfigureAwait(false); var clientConnections = _connectionsService.GetUserClientConnections(userId); clientConnections?.ForEach(connection => connection.Confirmed = true); return(Redirect(nameof(Index))); } catch (Exception ex) { return(StatusCode(500, ex.Message)); } }
public async Task SetUsersConfirmed() { var unconfirmed = fillTestDbHelper.Users.Where(opt => !opt.Confirmed.Value).ToList(); await updateUsersService.SetUsersConfirmedAsync(unconfirmed.Select(opt => opt.Id).ToList()); }