public override async Task <CreateMatrixReply> CreateMatrix(CreateMatrixRequest request, ServerCallContext context) { await _semaphoreSlim.WaitAsync(); var reply = new CreateMatrixReply(); try { var source = request.Source.Select(dl => dl.Doubles.ToArray()).ToArray(); ROpsApi.CreateMatrix(source.ToMultidimensional(), request.ObjectName); reply.Payload = new CreateMatrixPayload(); } catch (Exception ex) { reply.Error = PopulateError(ex); _logger.LogError(ex, nameof(CreateMatrix)); } finally { _semaphoreSlim.Release(); } return(await Task.FromResult(reply)); }
public void CreateMatrix([FromBody] CreateMatrixRequest model) { _service.CreateBattle(model.Range); }