【发布时间】:2014-08-06 04:39:40
【问题描述】:
例如,“Guid”类型被归类为“any”类型。
Uri 类型生成为复杂类型:
{
AbsolutePath: string;
AbsoluteUri: string;
Authority: string;
DnsSafeHost: string;
Fragment: string;
Host: string;
HostNameType: any;
IsAbsoluteUri: boolean;
IsDefaultPort: boolean;
IsFile: boolean;
IsLoopback: boolean;
IsUnc: boolean;
LocalPath: string;
OriginalString: string;
PathAndQuery: string;
Port: number;
Query: string;
Scheme: string;
Segments: string[];
UserEscaped: boolean;
UserInfo: string;
}
但实际上它被序列化为字符串。
所以...是否有可能以某种方式告诉 WebEssentials,如何序列化属性类型, 全局:
Guid -> string
Uri -> string
或按属性进行本地属性:
[TypescriptType(typeof(string))]
Guid Id {get; set;};
当然,全局按项目或解决方案更好。
【问题讨论】:
-
我不认为
TypescriptType来自网络要领...
标签: c# json serialization typescript web-essentials