Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }