简体   繁体   English

如何在 Entity Framework 4.0 中创建复杂类型

[英]How to create complex type in Entity Framework 4.0

While creating function imports in Model Browser, Get Column Information does not returns any columns, probably the reason is this在 Model 浏览器中创建 function 导入时,获取列信息不返回任何列,可能是这个原因

My stored procedure returns data from a temp table and at the end of procedure i drop that table.我的存储过程从临时表返回数据,并在过程结束时删除该表。

I am not sure, Please confirm, if this is the case, No column information, So create complex type is also not possible for this case.我不确定,请确认,如果是这种情况,没有列信息,因此这种情况也无法创建复杂类型。

Please suggest me how to create complex type manually for the procedures whose column information does not resolved by function imports screen.请建议我如何为 function 导入屏幕无法解析列信息的程序手动创建复杂类型。

Thanks谢谢

OMG, have you heard about Google ? OMG,你听说过谷歌吗?

How to create and modify complex types - first link!如何创建和修改复杂类型- 第一个链接!

EF is not able to infer complex types from stored procedures using some more complex techniques like dynamic SQL, temp tables, different result sets per control flow in stored procedure, multiple result sets, etc. EF 无法使用一些更复杂的技术从存储过程中推断复杂类型,例如动态 SQL、临时表、存储过程中每个控制流的不同结果集、多个结果集等。

There is no automated way to do this, you have to do it manually.没有自动的方法可以做到这一点,您必须手动完成。 Just do a right click on the complex type and start adding what you want to add.只需右键单击复杂类型并开始添加您要添加的内容。

I always JSON the object and save as string, then unJSON back.我总是 JSON object 并保存为字符串,然后 unJSON 返回。 Even for ExpandoObject , works well.即使对于ExpandoObject ,效果也很好。

Specially these days I save the data to Azure table, more easy to scale and affordable特别是这几天我将数据保存到 Azure 表中,更易于扩展且价格合理

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM