This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
if i run this code var _context = new LightSpeedContext<LSModel.LSModelUnitOfWork>(); it use this select SELECT consumers.consumerID AS "consumers.consumerID", consumers.Created AS "consumers.Created", consumers.Name AS "consumers.Name" without WHERE section
But if i change last line on var list = context.Consumers.Where( c => c.Id < 10); it work right and create WHERE section
|
|
|
addition: if i use var list = context.Consumers.Where( c => c.Id < 10); Console.Write(list.Count()); this corresponds SQL SELECT COUNT(*) FROM consumers WHERE consumers.consumerID < 10
Func<LSModel.Consumer, bool> predicate = c => c.Id < 10;
this corresponds SQL SELECT consumers.consumerID AS "consumers.consumerID", consumers.Created AS "consumers.Created", consumers.Name AS "consumers.Name"
without COUNT clause |
|
|
Thanks to all. The mistake I found a solution. Expression <Func <TSource, bool>> predicate); Func <TSource, bool> predicate); rewrote the code
var list = context.Consumers.Where(predicate);
everything worked. |
|