上次写的DBML存储过程返回值虽然可以返回非Int的值,但是有个小毛病。重新拖表或者存储过程,返回值又变成了<Return Type="System.Int32" />
<Table Name="dbo.Contract" Member="Contracts">
<Type Name="Contract" Id="ID1">
<Column Name="ContractId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" IsPrimaryKey="true" CanBeNull="false" />
</Type>
</Table> <Function Name="dbo.GetFilterContract" Method="GetFilterContract" IsComposable="true">
<Parameter Name="ContractTypeId" Parameter="contractTypeId" Type="System.Guid" DbType="UniqueIdentifier" />
<ElementType IdRef="ID1" />
</Function>
这样就OK了?
调用如下:
IQueryable<Contract> query = this.DataContexts.ContractDataContext.GetFilterContract( contractTypeID );
{SELECT [t0].[ContractId] FROM [dbo].[GetFilterContract](NULL, @p0, @p1, NULL, @p2, @p3) AS [t0]}
FROM 存储过程是有问题的。