| | |
| | | SequenceAttirbute? sequenceAttirbute = propertyInfo.GetCustomAttribute<SequenceAttirbute>(); |
| | | if (sequenceAttirbute != null) |
| | | { |
| | | if (propertyInfo.GetValue(entityInfo.EntityValue)?.ObjToInt() <= 0) |
| | | { |
| | | SqlSugarClient sugarClient = new SqlSugarClient(new ConnectionConfig |
| | | { |
| | | ConfigId = MainDb.CurrentDbConnId, |
| | |
| | | int seq = sugarClient.Ado.GetScalar($"SELECT NEXT VALUE FOR {sequenceAttirbute.SequenceName}").ObjToInt(); |
| | | propertyInfo.SetValue(entityInfo.EntityValue, seq, null); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | if (entityInfo.EntityValue is BaseEntity baseEntity) |