Quantcast
Channel: entityframework Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1793

New Post: Mapping of scalar UDF with enum as return type

$
0
0
Hi,

I have custom store convention which is used to translate method calls found in LINQ queries to scalar UDF functions. All functions are decorated with DbFunction attribute. Everything works as expected. You can see the code here.

But I want to modify some methods to return enum instead of int. I think it should work, but I always get the following exception.
The specified method 'Some.Documents.AccessType GetAccessType(Int64, Int64)' on the type 'Some.Documents.Docs' cannot be translated into a LINQ to Entities store expression because its return type does not match the return type of the function specified by its DbFunction attribute.
The modified method looks like this.
[DbFunction("UDF", "GetAccessType")]         
public static AccessType GetAccessType(long documentId, long userId)
{
    throw new NotImplementedException();
}
What do I need to make it working?

Thank you!

Viewing all articles
Browse latest Browse all 1793

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>