c# - How can I cast to IEnumerable in simple.data? -


i have query in simple.data

var db = database.open(); ienumerable<guid> recetas = db.factura .all() .where(db.factura.obrasocialplan_id == obrasocialplanid) .select(db.factura.id) .cast<guid>(); 

and i'm getting

cannot implicitly convert type 'simple.data.simplerecord' 'system.guid'

how should change query?

you can't enumerable, can materialise list this:

var db = database.open(); ienumerable<guid> recetas = db.factura .all() .where(db.factura.obrasocialplan_id == obrasocialplanid) .select(db.factura.id) .toscalarlist<guid>(); 

if want laziness, can pass enumerable somewhere without having run query, please raise issue on github page: http://github.com/markrendle/simple.data/issues

thanks.


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -