예제 #1
0
파일: Db.cs 프로젝트: yresk/Wexflow
 public override void InsertHistoryEntry(Core.Db.HistoryEntry entry)
 {
     using (var session = _store.OpenSession())
     {
         var he = new HistoryEntry
         {
             Description = entry.Description,
             LaunchType  = entry.LaunchType,
             Name        = entry.Name,
             Status      = entry.Status,
             StatusDate  = entry.StatusDate,
             WorkflowId  = entry.WorkflowId
         };
         session.Store(he);
         session.SaveChanges();
         Wait();
     }
 }
예제 #2
0
        public override void InsertHistoryEntry(Core.Db.HistoryEntry entry)
        {
            var col = _db.GetCollection <HistoryEntry>("historyEntries");
            var he  = new HistoryEntry
            {
                Description = entry.Description,
                LaunchType  = entry.LaunchType,
                Name        = entry.Name,
                Status      = entry.Status,
                StatusDate  = entry.StatusDate,
                WorkflowId  = entry.WorkflowId
            };

            col.InsertOne(he);
            col.Indexes.CreateOne(new CreateIndexModel <HistoryEntry>(Builders <HistoryEntry> .IndexKeys.Ascending(e => e.WorkflowId)));
            col.Indexes.CreateOne(new CreateIndexModel <HistoryEntry>(Builders <HistoryEntry> .IndexKeys.Ascending(e => e.Name)));
            col.Indexes.CreateOne(new CreateIndexModel <HistoryEntry>(Builders <HistoryEntry> .IndexKeys.Ascending(e => e.LaunchType)));
            col.Indexes.CreateOne(new CreateIndexModel <HistoryEntry>(Builders <HistoryEntry> .IndexKeys.Ascending(e => e.Description)));
            col.Indexes.CreateOne(new CreateIndexModel <HistoryEntry>(Builders <HistoryEntry> .IndexKeys.Ascending(e => e.Status)));
            col.Indexes.CreateOne(new CreateIndexModel <HistoryEntry>(Builders <HistoryEntry> .IndexKeys.Ascending(e => e.StatusDate)));
        }
예제 #3
0
파일: Db.cs 프로젝트: yresk/Wexflow
        public override void InsertHistoryEntry(Core.Db.HistoryEntry entry)
        {
            var col = _db.GetCollection <HistoryEntry>(Core.Db.HistoryEntry.DocumentName);
            var he  = new HistoryEntry
            {
                Description = entry.Description,
                LaunchType  = entry.LaunchType,
                Name        = entry.Name,
                Status      = entry.Status,
                StatusDate  = entry.StatusDate,
                WorkflowId  = entry.WorkflowId
            };

            col.Insert(he);
            col.EnsureIndex(e => e.WorkflowId);
            col.EnsureIndex(e => e.Name, "LOWER($.Name)");
            col.EnsureIndex(e => e.LaunchType);
            col.EnsureIndex(e => e.Description, "LOWER($.Name)");
            col.EnsureIndex(e => e.Status);
            col.EnsureIndex(e => e.StatusDate);
        }