2

我在 Castle ActiveRecord 2.12 中遇到以下查询问题:

var q = from o in SodisceFMClientVAR.Queryable
        where taxnos2.Contains(o.TaxFileNo)
        select o;

taxNos2 是一个字符串数组。

运行时出现异常:+

InnerException {“索引超出范围。必须为非负数且小于集合的大小。\r\n参数名称:索引”} System.Exception {System.ArgumentOutOfRangeException}

  StackTrace  "   at

Castle.ActiveRecord.ActiveRecordBase.ExecuteQuery(IActiveRecordQuery 查询)\r\n 在 Castle.ActiveRecord.Linq.LinqResultWrapper 1.Populate()\r\n at Castle.ActiveRecord.Linq.LinqResultWrapper1.GetEnumerator()\r\n 在 NHibernate.Linq.Query 1.GetEnumerator()\r\n at System.Linq.Buffer1..ctor(IEnumerable 1 source)\r\n at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 源)\r\ n 在 prosoft.skb.insolventnostDataAccess.InsolventnostDataAccAR.GetOurUsersListLS(ICollection 1 taxNos) in C:\\svn\\skb\\insolventnostWithAR\\prosoft.skb.insolventnostDataAccess\\InsolventnostDataAR.cs:line 214\r\n at prosoft.skb.insolventnostDataFromWS.InsolventnostFromWS.filterByOurUsers(IEnumerable1 odprtiPostopki) 在 C:\svn\skb\insolventnostWithAR\prosoft.skb.insolventnostDataFromWS\InsolventnostFromWS.cs:line 237\r\n 在 prosoft.skb.insolventnostDataFromWS.InsolventnostFromWS .SyncData() 在 C:\svn\skb\insolventnostWithAR\prosoft.skb.insolventnostDataFromWS\InsolventnostFromWS.cs:line 53" 字符串

包含甚至在 linq 中为 nhibernate 工作吗?我无法通过谷歌找到任何东西......有解决方法吗?

谢谢!

4

1 回答 1

1

好吧,我想通了-问题实际上出在映射到表的类中, DateTime 字段需要是 DateTime 吗?字段。

虽然奇怪的错误......

于 2010-04-07T11:46:18.633 回答