I am maintaining a visual studio 2008 application (website project). There is no chance to upgrade to higher version of.net framework or upper version of entity framework. Like many IT shops, unless there are major issues, people are not going to allow me to do major upgrade on the system.
The .net framework is 3.5. and the EF version is 1.0
I need to change my program, so my select linq statement will work
Calling a SQL User-defined function in a LINQ query
As you can tell, I need to include stored function as a part of select statement
So I copied the statement.
I have struggled for hours, and I keep getting compilation.
//..various using statement
using System.Data.Objects.DataClasses;
using System.Data.Metadata.Edm;
//..other class
public static class EntityFunctions
{
[EdmFunction("FBLModel.Store", "SampleFunction")]
public static int SampleFunction(int param)
{
throw new NotSupportedException("Direct calls are not supported.");
}
}
I keep getting compilation errors
error CS0246: The type or namespace name 'EdmFunctionAttribute' could not be found (are you missing a using directive or an assembly reference?)
I have searched the whole internet include stackoverflow and MSDN blog, the namespace looks correct
Any suggestions? Thank you