Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 ServiceStack 中实现的服务中,我已经将响应对象序列化为 JSON 字符串。如何在不序列化为字符串的情况下返回它?我想避免将其反序列化为 DTO 实例,然后由 ServiceStack 序列化回。
这是我从光盘加载 json 文件的片段:
if (File.Exists(jsonFileLocation)) { return new HttpResult(new FileInfo(jsonFileLocation), asAttachment: false, contentType: ContentType.Json); }