在实体框架中存储基元数组 [英] Store array of primitives in entity framework
问题描述
我需要使用自定义值转换器存储基元数组。例如,带有逗号分隔值的字符串数组:"Mon,Tue,Wed"。
是否可以在持久性期间以某种方式映射我的实体以使用转换器。
祝你好运,
Alexey Zakharov
嗨Alexey,
你想做这样的吗?在POCO实体中进行映射?
EF仅支持将基元类型和复杂类型映射到数据库列。
另外,请注意复杂类型不能是实体键。
您能否向我们提供有关您的方案的更多详细信息?
您希望如何将自定义值转换器映射到实体?
度过美好的一天!
最诚挚的问候,b
Lingzhi Sun
MSDN订阅者支持
在论坛
如果您对我们的支持有任何反馈,请联系
msdnmg@microsoft.com
Hi,
I need to store array of primitives using custom value converter. For example array of Day by string with comma separated values: "Mon, Tue, Wed".
Is it possible to map my entities somehow to use converter during persistence.
Best regards,
Alexey Zakharov
Hi Alexey,
Do you want to make such a mapping in POCO entities? EF only supports mapping primitive types and complex types to database columns. Also, note that complex types cannot be the entity key. Could you please provide us with more detailed information about your scenario? How do you want to map the custom value converter to the entities?
Have a nice day!
Best Regards,
Lingzhi SunMSDN Subscriber Support in Forum
If you have any feedback on our support, please contact msdnmg@microsoft.com
这篇关于在实体框架中存储基元数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!