private static IndexAnnotation CreateIndexAnnotation(string tableName, string propertyName, int count) { var indexName = IndexNameCreator.CreateName(tableName, propertyName); // If there are two Indicies on the same property, the count is added. // In SQLite an Index name must be global unique. // To be honest, it should never happen. But because its possible by using the API, it should be covered. if (count > 0) { indexName = String.Format(CultureInfo.InvariantCulture, "{0}_{1}", indexName, count); } var indexAttribute = new IndexAttribute(indexName); return(new IndexAnnotation(indexAttribute)); }
public void CreateIndexName() { string result = IndexNameCreator.CreateName("MyTable", "MyProperty"); Assert.AreEqual("\"IX_MyTable_MyProperty\"", result); }
private string GetIndexName(IndexAttribute index, EdmProperty property) { return(index.Name == null?IndexNameCreator.CreateName(entitySet.ElementType.GetTableName(), property.Name) : NameCreator.EscapeName(index.Name)); }