internal static string GetIndexUnique(PropertyInfo property) { CacheAttributes(property.DeclaringType); SqlLiteIndexAttribute indexAttribute = null; if (IndexAttributes.TryGetValue($"{property.DeclaringType.Name}-{property.Name}", out indexAttribute)) { return(indexAttribute.IndexType == SqlLiteIndexType.Unique ? "UNIQUE" : ""); } return(string.Empty); }
internal static string GetIndexName(PropertyInfo property) { CacheAttributes(property.DeclaringType); SqlLiteIndexAttribute indexAttribute = null; if (IndexAttributes.TryGetValue($"{property.DeclaringType.Name}-{property.Name}", out indexAttribute)) { return(indexAttribute.IndexName); } return(null); }
internal static string GetIndexAdditionalColumns(PropertyInfo property) { CacheAttributes(property.DeclaringType); SqlLiteIndexAttribute indexAttribute = null; if (IndexAttributes.TryGetValue($"{property.DeclaringType.Name}-{property.Name}", out indexAttribute)) { if (indexAttribute.AdditionalColumns != null) { return(string.Join(",", indexAttribute.AdditionalColumns)); } return(string.Empty); } return(string.Empty); }