public override async Task <SaveTextResponse> SaveTextAsString(SaveTextAsStringRequest request, ServerCallContext context) { var body = request.Body; await _textFileRepository.InsertAsync(new TextFile { Body = body }); return(new SaveTextResponse { Result = true }); }
public override async Task <SaveTextResponse> SaveTextAsString(SaveTextAsStringRequest request, ServerCallContext context) { _logger.LogInformation("Begin grpc call from method {Method} for save text as string", context.Method); var body = request.Body; await _textRepository.CreateAsync(new Text { Value = body }, context.CancellationToken); await _textRepository.SaveAsync(context.CancellationToken); context.Status = new Status(StatusCode.OK, "Save text as string complete"); return(new SaveTextResponse { Result = true }); }