开发者

Entity Framework 4 - Map Stored Proc that Returns Guid

开发者 https://www.devze.com 2023-02-05 16:12 出处:网络
Is there a way to map a stored proc in entity framework 4 that returns a guid scalar?All I see is to have it return a collection or an int scalar.

Is there a way to map a stored proc in entity framework 4 that returns a guid scalar? All I see is to have it return a collection or an int scalar.

My stored proc ends with a

开发者_运维技巧
select @id

where @id is the Guid I want back in code.


No - function imports in EF4 always return collections that implement IEnumerable. You can have it return a collection of guid scalars - but in your case, it would just be a collection with one object. Does that work for you?

Brian

0

精彩评论

暂无评论...
验证码 换一张
取 消