I experience problem with Linq query. Tested with both Mysql and Sqlite provider. I'm using version 7.2.77 resp. 4.2.77.
It can be reproduced with following table:
Code: Select all
CREATE TABLE `data_currency` (
`Id` smallint(6) NOT NULL AUTO_INCREMENT,
`Currency` varchar(15) NOT NULL,
PRIMARY KEY (`Id`)
)
Code: Select all
DB.DataCurrencies.Where(c => c.Id == 1).SingleOrDefault();
Code: Select all
Specified cast is not valid
Devart.Data.Linq.Engine.SingleKeyManager`2.a(Object[] A_0)
Devart.Data.Linq.Engine.KeyManager`2.b(Object[] A_0)
Devart.Data.Linq.Engine.ah.a(Expression A_0, Object& A_1)
Devart.Data.Linq.Engine.ah.e(Expression A_0)
Devart.Data.Linq.DataProvider.a(Expression A_0)
Devart.Data.Linq.Engine.DataQuery`1.System.Linq.IQueryProvider.Execute[S](Expression expression)
System.Linq.Queryable.SingleOrDefault[TSource](IQueryable`1 source)
Code: Select all
short id = 1;
DB.DataCurrencies.Where(c => c.Id == id).SingleOrDefault();