/
EvilBeaver
/
OneScript
Обзор
Документация
Войти
/
EvilBeaver
/
OneScript
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
develop
src/OneScript.DebugProtocol/TcpServer/RpcCallResult.cs
42 строки
1 KB
Andrei Ovsiankin
Канал обмена json объектами
15 июл 2025, 15:28
15 июл 2025, 15:28
be5c642
Код
Авторство
О чём код?
/*---------------------------------------------------------- This Source Code Form is subject to the terms of the Mozilla Public License, v.2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. ----------------------------------------------------------*/ using System; using Newtonsoft.Json; namespace OneScript.DebugProtocol.TcpServer { [Serializable] [JsonConverter(typeof(JsonDtoConverter))] public class RpcCallResult : TcpProtocolDtoBase { public object ReturnValue { get; set; } public static RpcCallResult Respond(RpcCall call, object value) { return new RpcCallResult { Id = call.Id, ServiceName = call.ServiceName, ReturnValue = value }; } public static RpcCallResult Exception(RpcCall call, Exception value) { return new RpcCallResult { Id = call.Id, ServiceName = call.ServiceName, ReturnValue = new RpcExceptionDto { Description = value.Message } }; } } }