我一直在使用RavenDB两个小时,所以如果我错过了一些显而易见的道歉。序列化/反序列化系统.Uri
我使用System.Uri类型的属性存储非规范化视图模型。 URI是序列化为一个字符串,它是好,我猜,但引发此异常,当我加载文档:
Message=Could not cast or convert from System.String to System.Uri.
Source=Newtonsoft.Json
StackTrace:
at Newtonsoft.Json.Utilities.ConvertUtils.EnsureTypeAssignable(Object value, Type initialType, Type targetType) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Utilities\ConvertUtils.cs:line 267
at Newtonsoft.Json.Utilities.ConvertUtils.ConvertOrCast(Object initialValue, CultureInfo culture, Type targetType) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Utilities\ConvertUtils.cs:line 244
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 544
Uri在数据库中看起来像什么? – ataddeini 2012-04-21 14:15:40
“Url”:“/ about-us” – 2012-04-21 14:16:57