Beispiel #1
0
        public override void UpdateDatabaseRecord(DatabaseRecord record, long etag)
        {
            if (Static != null)
            {
                foreach (var definition in Static)
                {
                    record.AddIndex(definition, Source, CreatedAt, etag, RevisionsToKeep, DefaultStaticDeploymentMode ?? IndexDeploymentMode.Parallel);
                }
            }

            if (Auto != null)
            {
                foreach (var definition in Auto)
                {
                    record.AddIndex(definition, CreatedAt, etag, DefaultAutoDeploymentMode ?? IndexDeploymentMode.Parallel);
                }
            }
        }
Beispiel #2
0
        public override void UpdateDatabaseRecord(DatabaseRecord record, long etag)
        {
            if (Static != null)
            {
                foreach (var definition in Static)
                {
                    record.AddIndex(definition, Source, CreatedAt, etag);
                }
            }

            if (Auto != null)
            {
                foreach (var definition in Auto)
                {
                    record.AddIndex(definition);
                }
            }
        }
Beispiel #3
0
 public override void UpdateDatabaseRecord(DatabaseRecord record, long etag)
 {
     try
     {
         record.AddIndex(Definition, CreatedAt, etag, DefaultStaticDeploymentMode ?? IndexDeploymentMode.Parallel);
     }
     catch (Exception e)
     {
         throw new RachisApplyException("Failed to update auto-index", e);
     }
 }
 public override void UpdateDatabaseRecord(DatabaseRecord record, long etag)
 {
     try
     {
         record.AddIndex(Definition);
     }
     catch (Exception e)
     {
         throw new RachisApplyException("Failed to update auto-index", e);
     }
 }
Beispiel #5
0
        public override string UpdateDatabaseRecord(DatabaseRecord record, long etag)
        {
            try
            {
                record.AddIndex(Definition);
            }
            catch (Exception e)
            {
                throw new RachisApplyException("Failed to update index", e);
            }

            return(null);
        }
        public override void UpdateDatabaseRecord(DatabaseRecord record, long etag)
        {
            try
            {
                var indexNames = record.Indexes.Select(x => x.Value.Name).ToHashSet(OrdinalIgnoreCaseStringStructComparer.Instance);

                if (indexNames.Add(Definition.Name) == false && record.Indexes.TryGetValue(Definition.Name, out var definition) == false)
                {
                    throw new InvalidOperationException($"Can not add index: {Definition.Name} because an index with the same name but different casing already exist");
                }
                record.AddIndex(Definition, Source, CreatedAt, etag);
            }
            catch (Exception e)
            {
                throw new RachisApplyException("Failed to update index", e);
            }
        }
 public override string UpdateDatabaseRecord(DatabaseRecord record, long etag)
 {
     record.AddIndex(Definition);
     return(null);
 }