自动执行存储过程/功能导入 [英] Automate stored procedure/function import

查看:77
本文介绍了自动执行存储过程/功能导入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


由于合理的命名约定,我知道哪些存储过程返回结果集(因此有人需要)决定他们返回的实体或复杂类型,以及哪些不返回任何内容。我想自动导入那些
。我已经有一个带有OnAfterModelUpdated处理程序的Visual Studio扩展,但是我不能调用"将存储过程foo导入为名为foo的方法返回任何内容"的方法。我可以自己更改edmx并添加映射和< FunctionImportMapping>
和< FunctionImport>,但后来我不知道所有这些数据库类型到.Net类型的映射。

Thanks to a sensible naming convention I know which stored procedures return a resultset (and therefore someone needs to decide what entity or complex type they return) and which ones don't return anything. I'd like to import those automaticaly. I already have a Visual Studio extension with an OnAfterModelUpdated handler, but I can't a method I could call to "import stored procedure foo as method named foo returning nothing". I can change the edmx myself and add the mapping and the <FunctionImportMapping> and <FunctionImport>, but then I don't know the mapping of all those database types to .Net types.

  ;

如果有办法显示"添加功能导入"在"从数据库更新模型"之后自动执行所有未映射过程的向导我也很感兴趣。

If there is a way to show the "Add Function Import" automatically after the "Update model from database" wizard for all unmapped procedures I'm also interested.

推荐答案

你好,

目前,没有。您必须手动将存储的procedureudre添加为函数import。假设您更新了模型并添加了多个存储过程,并且每个都返回不同的实体集合,或者其中一些不返回任何内容,如何将它们添加为
函数导入?

Currently, no. You have to manually add the stored procedudre as function import. Suppose you updated the model and add multiple stored procedure and each returns different entity collection or some of them do not return anything, how can you add them as function import?

" ;但后来我不知道所有这些数据库类型到.Net类型的映射。"

请查看此列表:

http://msdn.microsoft.com/en-us/library/ms131092(SQL.90)。 aspx

"but then I don't know the mapping of all those database types to .Net types."
Please take a look at this list:
http://msdn.microsoft.com/en-us/library/ms131092(SQL.90).aspx

问候,


这篇关于自动执行存储过程/功能导入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆