实体框架6为复杂的存储过程返回错误的类型

时间:2016-05-12 17:51:51

标签: c# sql-server entity-framework stored-procedures

我有一个存储过程,它明确地列出了许多列,因为它的结果。当我将存储过程添加到Entity Framework v6时,它不会添加_result.cs文件,并且它将存储过程看作只是返回一个int。

任何人都可以看到我不是吗?

@UserIn int,
@Lat float,
@Lng float
AS
BEGIN
    SET NOCOUNT ON;

    declare @or geography, @dest  geography
    select @or = geography::Point(@Lat, @Lng, 4326)

    select 
        Uid, SongKickId, SongKickArtistId, DisplayName, Type, Uri, 
        StartDate, StartDateTime, City, Lat, Lng, Capacity, ArtistId, 
        CreateDate, CreateUserId, IsActive, TwitterMsg, SocialMsg,
        Cast(0.0 as float) as [dist]
    from 
        SongKickEvent E 
    where 
        (E.Lat is not null and E.Lng is not null)
        and cast(StartDate as Date) = cast(getdate() as Date)
END

1 个答案:

答案 0 :(得分:0)

每当我遇到这个问题时,我都会指定一个人造数据合同。我从this SO帖子中了解到了这一点。