PDA

View Full Version : مشکل با اجرای تابع sql در ef



na3er-faraji
چهارشنبه 28 تیر 1391, 12:56 عصر
سلام مشکل کد زیر چیه ؟ کسی میتونه کمک کنه. اون GetEvaluationValue یک فانکشنه که تو sql کامپایل شده

public List<Personel> GetListByAnswer(Guid departmentId, Guid periodId)
{
using (var db = new EvaluationEXEEntities())
{
return (from prs in db.People
join emp in db.Employees on prs.PRS_UID equals emp.PRS_UID
join dpt in db.Departments on emp.DPT_UID equals dpt.DPT_UID
where emp.DPT_UID == departmentId
select new Personel
{
Name = prs.PRS_NAME,
Family = prs.PRS_LAST_NAME,
EmployeeNumber = emp.EMP_NUM,
EmployeeTitle = emp.EMP_TITLE,
EvaluationValue = db.ExecuteFunction<float>("SELECT dbo.GetEvaluationValue(@employeeId,@periodId) as Result", new ObjectParameter[]{
new ObjectParameter("@employeeId",emp.EMP_UID),
new ObjectParameter ("periodId", emp.DPT_UID)
}).First(),
SumValue = "0",
Level = "0"
}).ToList();
}
}