my code :
public List<Book> GetBook(string NameField, object Value)
{
var queryESQL = @"select VALUE Book from Book
where Cast(Book." + NameField + " as string) like '%M%'";
var query = this.Entities.CreateQuery<Book>(
queryESQL);
return query.ToList();
}
error :
Type 'string' could not be found. Make sure that the required schemas are loaded and that the namespaces are imported correctly. Near type name, line 2, column 51.
update :
new code :
public List<Book> GetBook(string NameField, object Value)
{
var queryESQL = @"select VALUE Book from Book
where Cast(Book." + NameField + " as EDM.string) like '%M%'";
var query = this.Entities.CreateQuery<Book>(
queryESQL);
return query.ToList();
}
error :
Type 'EDM.string' could not be found. Make sure that the required schemas are loaded and that the namespaces are imported correctly. Near type name, line 2, column 51.