mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-20 02:29:39 +08:00
Synchronization code
This commit is contained in:
@@ -429,6 +429,21 @@ namespace SqlSugar
|
|||||||
IndexFields.Add(fieldName10, sortType10);
|
IndexFields.Add(fieldName10, sortType10);
|
||||||
this.IsUnique = isUnique;
|
this.IsUnique = isUnique;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SugarIndexAttribute(string indexName, string[] fieldNames, OrderByType[] sortTypes, bool isUnique = false)
|
||||||
|
{
|
||||||
|
if (fieldNames.Length != sortTypes.Length)
|
||||||
|
{
|
||||||
|
Check.ExceptionEasy($"SugarIndexAttribute {indexName} fieldNames.Length!=sortTypes.Length 检查索引特性", $"SugarIndexAttribute {indexName} fieldNames.Length!=sortTypes.Length");
|
||||||
|
}
|
||||||
|
this.IndexName = indexName;
|
||||||
|
IndexFields = new Dictionary<string, OrderByType>();
|
||||||
|
for (int i = 0; i < fieldNames.Length; i++)
|
||||||
|
{
|
||||||
|
IndexFields.Add(fieldNames[i], sortTypes[i]);
|
||||||
|
}
|
||||||
|
this.IsUnique = isUnique;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user