RavenDB动态查询

时间:2014-02-28 20:05:43

标签: c# .net-4.5 ravendb

我收到错误:

System.InvalidOperationException occurred
  HResult=-2146233079
  Message=There is no index named: dynamic/Routes
  Source=Raven.Client.Lightweight
  StackTrace:
       at Raven.Client.Connection.ServerClient.DirectQuery(String index, IndexQuery query, OperationMetadata operationMetadata, String[] includes, Boolean metadataOnly, Boolean includeEntries)
       at Raven.Client.Connection.ServerClient.<>c__DisplayClass62.<Query>b__61(OperationMetadata u)
       at Raven.Client.Connection.ReplicationInformer.TryOperation[T](Func`2 operation, OperationMetadata operationMetadata, OperationMetadata primaryOperationMetadata, Boolean avoidThrowing, T& result, Boolean& wasTimeout)
       at Raven.Client.Connection.ReplicationInformer.ExecuteWithReplication[T](String method, String primaryUrl, OperationCredentials primaryCredentials, Int32 currentRequest, Int32 currentReadStripingBase, Func`2 operation)
       at Raven.Client.Connection.ServerClient.ExecuteWithReplication[T](String method, Func`2 operation)
       at Raven.Client.Document.AbstractDocumentQuery`2.ExecuteActualQuery()
       at Raven.Client.Document.AbstractDocumentQuery`2.get_QueryResult()
       at Raven.Client.Linq.RavenQueryProviderProcessor`1.ExecuteQuery[TProjection]()
       at Raven.Client.Linq.RavenQueryInspector`1.GetEnumerator()
       at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
       at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
       at Cwm.ReadModel.Users.UserEventsHandler.UpdateRoutes(User u)
  InnerException: 

运行简单查询

 session.Query<Route>().Where(r => r.User.Id == u.Id).ToList().ForEach(r => r.User = u);

如何修复/解决此问题?

0 个答案:

没有答案