using (var db = dbFactory.OpenDbConnection())
{
list = db.Select<ClientGlobal>(q=> q.Limit(1, 100));
}
The select Command throws ArgumentOutOfRangeException if I use q.Limit(0, 100) then all works fine.
the exception has the following message and stack trace.
StartIndex cannot be less than zero.
Parameter name: startIndex
at System.String.Remove(Int32 startIndex)
at ServiceStack.OrmLite.SqlServer.SqlServerExpression`1.ToSelectStatement()
at ServiceStack.OrmLite.ReadExtensions.Select[T](IDbCommand dbCmd, Func`2 expression)
at ServiceStack.OrmLite.ReadConnectionExtensions.<>c__DisplayClass4`1.<Select>b__3(IDbCommand dbCmd)
at ServiceStack.OrmLite.OrmLiteExecFilter.Exec[T](IDbConnection dbConn, Func`2 filter)
at ServiceStack.OrmLite.ReadConnectionExtensions.Exec[T](IDbConnection dbConn, Func`2 filter)
at ServiceStack.OrmLite.ReadConnectionExtensions.Select[T](IDbConnection dbConn, Func`2 expression)
at Millennium.Meevo.Server.Plugins.OnlineBooking.DataAccess.ClientGlobalTest.GetClientGlobalTest() in c:\Development\Millennium\Evo-Dev\Server\Plugins\Millennium.Meevo.Server.Plugins.OnlineBooking.DataAccess\ClientGlobalTest.cs:line 19
i'm using sql server 2012 Developer
Looking into the source code was I think the error is happening in var selectExpression = SelectExpression.Remove(SelectExpression.IndexOf("FROM")).Trim(); //0
So i'm assuming that SelectExpression at this moment is an empty string or something.