我正在使用服务堆栈ServiceStack.OrmLite.SqlServer从SQL DB中提取数据。我正在加入3个表,但我只需要3个表中的2个表的数据。当我执行查询时,我得到以下错误。我查了服务堆栈示例,一切似乎都一样,但我仍然得到错误。 我错过了什么吗?
错误:
' AT.Data.Model.Veh'不包含的定义 '创建'
堆栈跟踪:
at CallSite.Target(Closure , CallSite , Object )
at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
at AT.Data.Layer.ATSQLRepository.FetchData() in C:*****.cs:line 446" string
以下是查询:
var response = dbconnection.From<Veh>()
.Join<Veh, Dist>((v, d) => v.VehID == d.VehID)
.Join<Dist, Deal>((dist, deal) => dist.DistID == deal.DistID)
.Where(x => x.VehID == "B")
.And<Dist>(dist.St.ToUpper() == "Z")
.And<Deal>(deal => deal.St.ToUpper() == "X")
.Select<Veh, Deal>((v, deal) => new {v.VAL,deal.Created});
var results = dbconnection.Select(response);