does Entity framework support user defined functions as scalar properties -
I would like to include the value of a scalar function as a unit's read-only property, because it is included Could that value be possible in a filter?
To define a solution such as the following sample:
& Lt ;! - SSDL content - & gt; & Lt; EntitySet name = "Emp" EntityType = "TestModel.Store.Emp" & gt; & Lt; Defining System & gt; EMP & lt; / DefiningQuery & gt; Select EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO, dbo.MyFunc (DEPTNO) & amp; as LM with DMM; / EntitySet & gt; & Lt; EntityType name = "Emp" & gt; & Lt; Key & gt; & Lt; PropertyRef name = "EMPNO" /> & Lt; / Key & gt; & Lt; Property Name = "EMPNO" type = "int" Nullable = "false" /> ... & lt; Property Name = "DNAME" type = "varchar" MaxLength = "20" /> & Lt; / EntityType & gt; ... & lt ;! - CSDL content - & gt; ... & lt; EntityType name = "Emp" & gt; & Lt; Key & gt; & Lt; PropertyRef name = "EMPNO" /> & Lt; / Key & gt; & Lt; Property Name = "EMPNO" type = "Int32" Nullable = "false" /> ... & lt; Property Name = "Dname" Type = "String" Maxceland = "20" Unicode = "False" Fixed Landline = "False" /> & Lt; / EntityType & gt; & Lt ;! - C-S mapping content - & gt; ... & lt; ScalarProperty name = "EMPNO" columnname = "EMPNO" /> ... & lt; ScalarProperty name = "DNAME" columnname = "DNAME" /> ...
Usage examples:
using (TestEntities4 db = New TestEntities4 ()) {var q = e to db.Emp in where E .DNAME == Choose "Research" e; }
Comments
Post a Comment