【发布时间】:2014-08-01 09:32:13
【问题描述】:
我的 sql 数据库中有一个标量值函数。
将此函数导入实体框架模型时收到此错误:
Error 6046: Unable to generate function import return type of the store function 'GetContentByIdAndCul'.
The store function will be ignored and the function import will not be generated. ..\EntityModels.edmx
我的函数 tsql 是:
ALTER FUNCTION [FRM].[GetContentByIdAndCul]
(@Id int,@Culture nvarchar(5))
RETURNS nvarchar(max)
AS
BEGIN
declare @Result nvarchar(max)
if @Id is not null
set @Result='This Content not defined in this Language'
select @Result=Value from CUL.Contents
WHERE ID=@Id AND (CUL.Contents.Culture = LOWER(@Culture)
OR CUL.Contents.Culture = LOWER(SUBSTRING(@Culture,1,2)))
return @Result
END
【问题讨论】:
标签: linq entity-framework sql-function