I have an Int64 field that I want to convert in my EF Dynamic Linq query. This because I want to use teh Contains function to check if the Int64 contains a certain serie of numbers. So I use the SqlFunctions.StringConvert like
SqlFunctions.StringConvert(MyField).Contains("2012")
The Dynamic library raises a ParseException: No applicable method 'StringConvert' exists in type 'SqlFunctions'.
I changed this array in the Dynamic library so the SqlFunctions would be defined:
static readonly Type[] predefinedTypes = {
typeof(Object),
...
typeof(Math),
typeof(Convert),
typeof(EntityFunctions),
typeof(SqlFunctions)
};
Strange thing is: I also added EntityFunctions, and that works fine, exemple:
EntityFunctions.TruncateTime(LastCommentDate) = @0
UPDATE: Int64 not supported by SqlFunctions:
public static string StringConvert(decimal? number);
public static string StringConvert(double? number);
public static string StringConvert(decimal? number, int? length);
public static string StringConvert(double? number, int? length);
public static string StringConvert(decimal? number, int? length, int? decimalArg);
public static string StringConvert(double? number, int? length, int? decimalArg);