Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 2b7e948

Browse files
committed
Only Sequence fields have sequences
1 parent 16ac261 commit 2b7e948

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/ServiceStack.OrmLite.SqlServer/SqlServer2012OrmLiteDialectProvider.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,9 @@ public override List<string> SequenceList(Type tableType)
5454

5555
foreach (var fieldDef in modelDef.FieldDefinitions)
5656
{
57-
if (fieldDef.AutoIncrement || !fieldDef.Sequence.IsNullOrEmpty())
57+
if (!string.IsNullOrEmpty(fieldDef.Sequence))
5858
{
59-
if (gens.IndexOf(fieldDef.Sequence) == -1)
60-
gens.Add(fieldDef.Sequence);
59+
gens.AddIfNotExists(fieldDef.Sequence);
6160
}
6261
}
6362
return gens;

src/ServiceStack.OrmLite/OrmLiteConfigExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ internal static ModelDefinition GetModelDefinition(this Type modelType)
160160
IsReference = referenceAttr != null && propertyType.IsClass,
161161
GetValueFn = propertyInfo.CreateGetter(),
162162
SetValueFn = propertyInfo.CreateSetter(),
163-
Sequence = sequenceAttr != null ? sequenceAttr.Name : string.Empty,
163+
Sequence = sequenceAttr?.Name,
164164
IsComputed = computeAttr != null || computedAttr != null || customSelectAttr != null,
165165
ComputeExpression = computeAttr != null ? computeAttr.Expression : string.Empty,
166166
CustomSelect = customSelectAttr?.Sql,

0 commit comments

Comments
 (0)