public static ColumnIndexInfo WithInfoFromAbstractIndexAttribute(this ColumnIndexInfo indexInfo, AbstractIndexAttribute indexAttribute) { indexInfo.Order = indexAttribute.Order; indexInfo.IsDescending = indexAttribute.IsDescending; return(indexInfo); }
public static ColumnIndexInfo WithInfoFromUniqueIndexAttribute(this ColumnIndexInfo indexInfo, UniqueIndexAttribute attribute) { if (attribute != null) { indexInfo.IndexType = IndexType.UniqueIndex; } return(indexInfo); }
public static ColumnIndexInfo WithInfoFromFullTextIndexAttribute(this ColumnIndexInfo indexInfo, FullTextIndexAttribute indexAttribute) { if (indexAttribute == null) { return(indexInfo); } indexInfo.IndexType = IndexType.FullTextIndex; var tmp = indexInfo.FullTextCatalog ?? new FullTextCatalogInfo(); tmp.Name = indexAttribute.FullTextCatalogName; indexInfo.FullTextCatalog = tmp; return(indexInfo); }
private static ColumnIndexInfo GetOrCreateColumnIndexInfo(ColumnInfo columnInfo, AbstractIndexAttribute indexAttribute) { var indexName = indexAttribute.Name?.Trim() ?? ""; var indexInfo = columnInfo.ColumnIndexes.SingleOrDefault(a => a.IndexName == indexName); if (indexInfo != null) { return(indexInfo); } indexInfo = new ColumnIndexInfo { IndexName = indexName }; columnInfo.ColumnIndexes.Add(indexInfo); return(indexInfo); }