如何在edmx file..explain中详细使用存储过程 [英] how to use stored procedure in edmx file..explain in details

查看:93
本文介绍了如何在edmx file..explain中详细使用存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是edmx的初学者..如果你有详细信息,那么plz提供示例..我在调用实体时遇到问题



 使用(CompanyEmployeesEntities ctx =  new  CompanyEmployeesEntities())
{
}



im无法调用此函数..plz帮助





谢谢你。

解决方案

按照以下有良好示例的链接:



Link 1



你也可以直接使用:



例子



 使用 var  ctx =  new  SchoolDBEntities())
{
// 将存储过程作为函数执行
var courseList = ctx.GetCoursesByStudentId( 1 )ToList<课程和GT;();


foreach (课程cs in courseList)
Console.WriteLine( 课程名称:{0},cs.CourseName);
}


互联网是你的朋友



http:// www。 entityframeworktutorial.net/stored-procedure-in-entity-framework.aspx

I m beginner in edmx..if u have details then plz provide with example..I have problem during calling entities

using (CompanyEmployeesEntities ctx = new CompanyEmployeesEntities())
{
}


i m unable to call this function..plz help


Thank u.

解决方案

Follow the link having good example:

Link 1

also you can directly use:

EXAMPLE

using (var ctx = new SchoolDBEntities())
        {
            //Execute stored procedure as a function
            var courseList = ctx.GetCoursesByStudentId(1).ToList<Course>();


            foreach (Course cs in courseList)
                Console.WriteLine("Course Name: {0}",cs.CourseName);
        }


The internet is your friend

http://www.entityframeworktutorial.net/stored-procedure-in-entity-framework.aspx


这篇关于如何在edmx file..explain中详细使用存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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