public class CheckResultLog
{
[AutoIncrement]
public int Id { get; set; }
public int WatchItemId { get; set; }
public string Url { get; set; }
public string DL { get; set; }
public string XL { get; set; }
public ResultFlag code { get; set; }
public string msg { get; set; }
public DateTime Time { get; set; }
}
using (var db = dbFactory.Open())
{
logs = db.Select<CheckResultLog>(x => x.Time.Date == DateTime.Now.Date);//will throw null reference
logs = db.Select<CheckResultLog>();//this is ok
}
q1:I want to select the logs at same day, how should I do, may be should (xx.year == now.year xx.month = now.month xx.day == now.day )?..
q2: how deal db entry row by row
3q!
next is the stack
System.NullReferenceException : 。
在 ServiceStack.OrmLite.SqlExpression`1.GetQuotedColumnName(ModelDefinition tableDef, String memberName)
在 ServiceStack.OrmLite.SqlExpression`1.GetMemberExpression(MemberExpression m)
在 ServiceStack.OrmLite.SqlExpression`1.VisitMemberAccess(MemberExpression m)
在 ServiceStack.OrmLite.SqlExpression`1.Visit(Expression exp)
在 ServiceStack.OrmLite.SqlExpression`1.VisitBinary(BinaryExpression b)
在 ServiceStack.OrmLite.SqlExpression`1.Visit(Expression exp)
在 ServiceStack.OrmLite.SqlExpression`1.VisitLambda(LambdaExpression lambda)
在 ServiceStack.OrmLite.SqlExpression`1.Visit(Expression exp)
在 ServiceStack.OrmLite.SqlExpression`1.AppendToWhere(String condition, Expression predicate)
在 ServiceStack.OrmLite.SqlExpression`1.Where(Expression`1 predicate)
在 ServiceStack.OrmLite.ReadExpressionCommandExtensions.Select[T](IDbCommand dbCmd, Expression`1 predicate)
在 ServiceStack.OrmLite.OrmLiteReadExpressionsApi.<>c__DisplayClass14_0`1.<Select>b__0(IDbCommand dbCmd)
在 ServiceStack.OrmLite.OrmLiteExecFilter.Exec[T](IDbConnection dbConn, Func`2 filter)
在 ServiceStack.OrmLite.OrmLiteReadExpressionsApi.Exec[T](IDbConnection dbConn, Func`2 filter)
在 ServiceStack.OrmLite.OrmLiteReadExpressionsApi.Select[T](IDbConnection dbConn, Expression`1 predicate)