Я пытаюсь перевести следующий SQL-Select в LINQ to Entities, но у меня возникла проблема с проверкой isnumeric, и я надеюсь, что сообщество подскажет мне, как ее решить.
< br />
Код: Выделить всё
select top(1) column1
from myDataTable with (nolock)
where id = '123456789'
and ISNUMERIC(column1) = 0
Я попробовал следующее в LINQ to Entities, чтобы получить всю строку из таблицы:
Код: Выделить всё
int column1Value;
int paramId = 123456789;
var entry = myDataTable.FirstOrDefault(
x => x.Id == paramId && !(int.TryParse(x.column1, out column1Value))
);
But when I debug it, I get the following error
LINQ to Entities does not recognize the method 'Boolean TryParse(System.String, Int32 ByRef)'.
How can I implement the isnumeric check in LINQ?
Источник: https://stackoverflow.com/questions/781 ... o-entities
Мобильная версия