2012-03-23 2 views

답변

1

예. 이것은 지원되는데, 여기 howto에 대한 간단한 설명이 있습니다.

당신의 EF SSDL를 변경 :

<Function Name="AvgStudentGrade" ReturnType="decimal" Schema="dbo" > 
    <Parameter Name="studentId" Mode="In" Type="int" /> 
</Function> 

적절한 속성을 가지는 방법 스텁을 추가로

var students = from s in context.People 
        where s.EnrollmentDate != null 
        select new 
        { 
         name = s.LastName, 
         avgGrade = AvgStudentGrade(s.PersonID) 
        }; 

더 많은 정보와 전체 샘플 :

[EdmFunction("SchoolModel.Store", "AvgStudentGrade")] 
public static decimal? AvgStudentGrade(int studentId) 
{ 
    throw new NotSupportedException("Direct calls are not supported."); 
} 

그것을 사용
http://msdn.microsoft.com/en-us/library/dd456847(VS.100).aspx

+0

답장을 보내 주셔서 감사합니다. 나는 볼 수 없지만 .edmx 및 디자이너 파일. SSDL 파일을 사용할 수 없습니다. 그것을 찾는 방법? 감사 – Bill

관련 문제