Пример #1
0
        protected override async Task OnInitializedAsync()
        {
            var connectionTask = StarshipApi.GetConnectionsAsync();
            var baseTask       = StarshipApi.GetBasisAsync();
            await Task.WhenAll(connectionTask, baseTask);

            (Points, Connections) = Flightplan.PrepareFlightplan(connectionTask.Result.ToArray(), baseTask.Result.ToArray(), (250d, 250d));
        }
Пример #2
0
    protected override async Task OnInitializedAsync()
    {
        if (StarshipApi == null || Flightplan == null)
        {
            throw new InvalidOperationException("Properties not initialized by DI. Configuration error?");
        }

        var connectionTask = StarshipApi.GetConnectionsAsync();
        var baseTask       = StarshipApi.GetBasisAsync();
        await Task.WhenAll(connectionTask, baseTask);

        (Points, Connections) = Flightplan.PrepareFlightplan(connectionTask.Result.ToArray(), baseTask.Result.ToArray(), (250d, 250d));
    }