If you use a custom method in EF, you get a dreaded error like:
LINQ to Entities does not recognize the method 'Boolean IsNullOrWhiteSpace(System.String)' method, and this method cannot be translated into a store expression.
You can fix this by specifying the "store expression" you want to use, as described in this StackOverflow answer.
Open up your *.edmx file in a text editor, and look for the
<edmx:ConceptualModels>
tag. Under that you should see a<Schema Namespace="YourModel" ...>
tag. Inside the Schema tag, add the following...
This answer involves updating the EDMX file for the database, and so you'd have to copy and paste the relevant code into every project.
Is it possible to add the custom method in a library, or via code that you could reuse, so you can share frequently used custom store functions across all projects, and not have to update the EDMX manually in every project?