zoukankan      html  css  js  c++  java
  • RavenDb使用

    在Raven中查询数据,查询条件必须在index中。

    如果查询条件不在index中就会出现如下异常

                    var query = session.DynamicIndexQuery<ServiceProviderCallTransaction>()
                                        .Where(x => x.LocationId == request.Id).ToList()

    System.ArgumentException: The field 'LocationId' is not indexed, cannot query on fields that are not indexed

    在Raven中创建Index

    public class App_ActivityLog : AbstractIndexCreationTask<ActivityLog>
        {
            public App_ActivityLog()
            {
                Map = records => from record in records
                                 select new
                                 {
                                     Id = record.Id,
                                     ClientId = record.ClientId,
                                     ActivityDate = record.ActivityDate,
                                     CategoryId = record.CategoryId,
                                     NameId = record.NameId,
                                     StaffId = record.StaffId,
                                     Status_Value = record.Status.Value,
                                     LocationId = record.LocationId,
                                     ProcedureCode = record.ProcedureCode,
                                     Affiliation_Value = record.Affiliation.Value,
                                     SourceReferenceId = record.SourceReferenceId,
                                     ClaimId = record.ClaimId,
                                     ProgramTypeId = record.ProgramTypeId
                                 };
            }
        }
  • 相关阅读:
    模块cv2的用法
    调整弹出对话框在ASP.NET应用程序的大小
    xaf 自定义登陆页
    xaf 修改主页logo
    显示一个列表视图图表
    双击直接编辑状态
    xaf 富文本框添加方法
    用户 'NT AUTHORITYIUSR' 登录失败
    C# 中的INotifyPropertyChanged
    线程间操作无效: 从不是创建控件“txtreceive”的线程访问它。
  • 原文地址:https://www.cnblogs.com/13579net/p/3484059.html
Copyright © 2011-2022 走看看