我正在序列化来自上传图像的元数据,以便能够将其保存在数据库中。序列化和反序列化元数据提取器dotnet
这是可能的序列化使用个人JsonConverter从Newtonsoft(JSON.NET)数据 - 但是反序列化失败:
(IReadOnlyList<MetadataExtractor.Directory>)JsonConvert.DeserializeObject(metadata)
与此异常:
An exception of type 'Newtonsoft.Json.JsonSerializationException' occurred in Newtonsoft.Json.dll but was not handled in user code
Additional information: Could not create an instance of type MetadataExtractor.Directory. Type is an interface or abstract class and cannot be instantiated. Path '[0].Name', line 1, position 9.
由于名单目录可能会有所不同,具体取决于具体的对象,我怀疑这是微不足道的单独序列化/反序列化目录。
有关如何仅将上传图像的元数据部分保存为可以稍后重新使用的表单的简单建议?
请问你的元数据是什么样子?你可以发布吗? – Mahdi