Raven.Database.Storage.IndexDefinitionStorage.AddIndex C# (CSharp) Method

AddIndex() public method

public AddIndex ( string name, Raven.Database.Indexing.IndexDefinition definition ) : void
name string
definition Raven.Database.Indexing.IndexDefinition
return void
        public void AddIndex(string name, IndexDefinition definition)
        {
			var fixedName = FixupIndexName(name);
			indexDefinitions.AddOrUpdate(fixedName, definition, (s1, def) =>
            {
                if (def.IsCompiled)
                    throw new InvalidOperationException("Index " + name + " is a compiled index, and cannot be replaced");
                return definition;
            });
        }