Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Entity framework 4 实体框架电动工具CTP1能否为存储过程生成类?_Entity Framework 4_Ef Code First_Reverse Engineering - Fatal编程技术网

Entity framework 4 实体框架电动工具CTP1能否为存储过程生成类?

Entity framework 4 实体框架电动工具CTP1能否为存储过程生成类?,entity-framework-4,ef-code-first,reverse-engineering,Entity Framework 4,Ef Code First,Reverse Engineering,当我首先使用Entity Framework Power Tools CTP1提供的反向工程代码时,是否有任何方法为我的数据库中的存储过程生成类?否。如果您想让代码用于调用任何工具生成的存储过程,请使用EDMX和数据库优先方法。否,它不会为您生成,但会使用只要稍加努力,就可以将它们整合起来。 您只需从表中生成,然后在存储库层中返回一个实体: public Customer GetById(int id) { return_context.D

当我首先使用Entity Framework Power Tools CTP1提供的反向工程代码时,是否有任何方法为我的数据库中的存储过程生成类?

否。如果您想让代码用于调用任何工具生成的存储过程,请使用EDMX和数据库优先方法。

否,它不会为您生成,但会使用只要稍加努力,就可以将它们整合起来。 您只需从表中生成,然后在存储库层中返回一个实体:

        public Customer GetById(int id)
        {
            return_context.Database.SqlQuery("Proc_GetCustomer @customerID", new SqlParameter("@customerID", id));
        }

“为存储过程生成类”是什么意思?生成实体类,映射存储过程?我的意思是生成类作为Edmx文件为所选存储过程生成类。