TSB.Customizer/TSB.Customizer/TSBAccountDefLogic.cs
Decompiler Source FileTSB.Customizer.TSBAccountDefLogicDecompiled Source
Interpretation
- Decompiled source file. Use method/event registrations and call-site extraction to connect back to DialogMethod, QBMEvent, and API layers.
Relations
- ExtendedMethod registration: AssignAccountDef at line 1906
- ExtendedMethod registration: RevokeAccountDef at line 1909
Typed Edges
- No typed edges extracted for this source.
References
- No direct source references extracted.
Referenced By
- No direct source references extracted.
C# source-derived context
Generated by pattern extraction from the decompiled C# source and decompile index. This is factual source evidence, not inferred behavior.
reads entity values references DB/Dialog objects
Summary: classes TSBAccountDefLogic, _003C_003Ec__DisplayClass10_0, _003C_003Ec__DisplayClass11_0, _003C_003Ec__DisplayClass11_1; methods _003CCheckTSBBahavior_003Eb__0, _003CCheckUniqueAccount_003Eb__0, _003CCheckUniqueAccount_003Eb__1, _003CExistsPersonHasTSBAccountDef_003Eb__0, _003CAssignAccountDef_OnSaving_003Eb__0, _003CRevokeAccountDef_003Eb__0; references Person, PersonHasTSBAccountDef, TSBAccountDef, TSBAccountDefHasBehavior, TSBBehavior, TSBPersonUsesAccount; markers reads entity values, references DB/Dialog objects
Classes
TSBAccountDefLogic _003C_003Ec__DisplayClass10_0 _003C_003Ec__DisplayClass11_0 _003C_003Ec__DisplayClass11_1 _003C_003Ec__DisplayClass1_0 _003C_003Ec__DisplayClass3_0 _003C_003Ec__DisplayClass4_0 _003C_003Ec__DisplayClass5_0 _003C_003Ec__DisplayClass8_0 _003C_003Ec__DisplayClass9_0Methods
- _003CCheckTSBBahavior_003Eb__0
- _003CCheckUniqueAccount_003Eb__0
- _003CCheckUniqueAccount_003Eb__1
- _003CExistsPersonHasTSBAccountDef_003Eb__0
- _003CAssignAccountDef_OnSaving_003Eb__0
- _003CRevokeAccountDef_003Eb__0
- _003CRevokeAccountDef_OnSaving_003Eb__0
- _003COnSavedAsync_003Eb__0
- _003CCheckPersonHasTSBAccountDef_003Eb__0
- MoveNext
- SetStateMachine
- ExistsPersonHasTSBAccountDef
- AssignAccountDef
- AssignAccountDef_OnSaving
- RevokeAccountDef
- RevokeAccountDef_OnSaving
- GetLocalDependenciesAsync
- OnSavingAsync
- OnSavedAsync
- CheckPersonHasTSBAccountDef
- CheckTSBBahavior
- CheckUniqueAccount
DB/Dialog object references
OIM key/entity markers
UID_TSBAccountDef UID_TSBBehavior UID_Person ObjectKeyAccountAPI/entity calls
GetValue TryResult ExistsAsync PutValueAsync TryPutValueAsync From Source IsDeleted MetaData Contains IsFullSync IsTransport CreateAsyncRegistrations / handlers
None extracted.
Complete Source
1using System;2using System.Collections;3using System.Collections.Generic;4using System.Diagnostics;5using System.Linq;6using System.Runtime.CompilerServices;7using System.Runtime.InteropServices;8using System.Threading;9using System.Threading.Tasks;10using VI.Base;11using VI.Base.Graphs;12using VI.DB;13using VI.DB.Entities;14using VI.DB.MetaData;1516namespace TSB.Customizer;1718public class TSBAccountDefLogic : StateBasedEntityLogic19{20 [CompilerGenerated]21 private sealed class _003C_003Ec__DisplayClass10_022 {23 public string uidTsbAccountDef;2425 public string uidTSBBehavior;2627 internal ExpressionClause _003CCheckTSBBahavior_003Eb__0(IExpressionContext c)28 {29 return c.Column("UID_TSBAccountDef") == uidTsbAccountDef && c.Column("UID_TSBBehavior") == uidTSBBehavior;30 }31 }3233 [CompilerGenerated]34 private sealed class _003C_003Ec__DisplayClass11_035 {36 public string uidTsbAccountDef;3738 public string uidPerson;3940 public IEntity entity;4142 internal ExpressionClause _003CCheckUniqueAccount_003Eb__0(IExpressionContext c)43 {44 return c.Column("UID_TSBAccountDef") == uidTsbAccountDef && c.Column("UID_Person") == uidPerson;45 }46 }4748 [CompilerGenerated]49 private sealed class _003C_003Ec__DisplayClass11_150 {51 public string strPk;5253 public _003C_003Ec__DisplayClass11_0 CS_0024_003C_003E8__locals1;5455 internal ExpressionClause _003CCheckUniqueAccount_003Eb__1(IExpressionContext c)56 {57 return c.Column(strPk) != CS_0024_003C_003E8__locals1.entity.GetValue<string>(strPk);58 }59 }6061 [CompilerGenerated]62 private sealed class _003C_003Ec__DisplayClass1_063 {64 public string uidTSBAccountDef;6566 public string uidPerson;6768 internal ExpressionClause _003CExistsPersonHasTSBAccountDef_003Eb__0(IExpressionContext c)69 {70 return c.Column("UID_TSBAccountDef") == uidTSBAccountDef && c.Column("UID_Person") == uidPerson && c.Column("XIsInEffect") == true;71 }72 }7374 [CompilerGenerated]75 private sealed class _003C_003Ec__DisplayClass3_076 {77 public IEntity entity;7879 internal ExpressionClause _003CAssignAccountDef_OnSaving_003Eb__0(IExpressionContext c)80 {81 return c.Column("UID_TSBAccountDef") == entity.GetValue<string>("UID_TSBAccountDef") && c.Column("UID_Person") == entity.GetValue<string>("UID_Person");82 }83 }8485 [CompilerGenerated]86 private sealed class _003C_003Ec__DisplayClass4_087 {88 public IEntity entity;8990 internal ExpressionClause _003CRevokeAccountDef_003Eb__0(IExpressionContext c)91 {92 return c.Column("UID_TSBAccountDef") == entity.GetValue<string>("UID_TSBAccountDef") && c.Column("UID_Person") == entity.GetValue<string>("UID_Person");93 }94 }9596 [CompilerGenerated]97 private sealed class _003C_003Ec__DisplayClass5_098 {99 public IEntity entity;100101 internal ExpressionClause _003CRevokeAccountDef_OnSaving_003Eb__0(IExpressionContext c)102 {103 return c.Column("UID_TSBAccountDef") == entity.GetValue<string>("UID_TSBAccountDef[o]") && c.Column("UID_Person") == entity.GetValue<string>("UID_Person[o]");104 }105 }106107 [CompilerGenerated]108 private sealed class _003C_003Ec__DisplayClass8_0109 {110 public DbObjectKey dbok;111112 internal ExpressionClause _003COnSavedAsync_003Eb__0(IExpressionContext c)113 {114 return c.Column("ObjectKeyAccount") == dbok.ToXmlString();115 }116 }117118 [CompilerGenerated]119 private sealed class _003C_003Ec__DisplayClass9_0120 {121 public string uidTSBAccountDef;122123 public string uidPerson;124125 internal ExpressionClause _003CCheckPersonHasTSBAccountDef_003Eb__0(IExpressionContext c)126 {127 return c.Column("UID_TSBAccountDef") == uidTSBAccountDef && c.Column("UID_Person") == uidPerson;128 }129 }130131 [StructLayout((LayoutKind)3)]132 [CompilerGenerated]133 private struct _003CAssignAccountDef_003Ed__2 : IAsyncStateMachine134 {135 public int _003C_003E1__state;136137 public AsyncTaskMethodBuilder<bool> _003C_003Et__builder;138139 public string uidPerson;140141 public string uidTSBAccountDef;142143 public TSBAccountDefLogic _003C_003E4__this;144145 public IEntity entity;146147 public CancellationToken ct;148149 public string uidTSBBehavior;150151 private System.IDisposable _003C_003E7__wrap1;152153 private ConfiguredValueTaskAwaiter<ApplyResult> _003C_003Eu__1;154155 private void MoveNext()156 {157 //IL_0024: Unknown result type (might be due to invalid IL or missing references)158 //IL_00be: Unknown result type (might be due to invalid IL or missing references)159 //IL_00c3: Unknown result type (might be due to invalid IL or missing references)160 //IL_00ca: Unknown result type (might be due to invalid IL or missing references)161 //IL_013e: Unknown result type (might be due to invalid IL or missing references)162 //IL_0143: Unknown result type (might be due to invalid IL or missing references)163 //IL_014a: Unknown result type (might be due to invalid IL or missing references)164 //IL_01c8: Unknown result type (might be due to invalid IL or missing references)165 //IL_01cd: Unknown result type (might be due to invalid IL or missing references)166 //IL_01d4: Unknown result type (might be due to invalid IL or missing references)167 //IL_0073: Unknown result type (might be due to invalid IL or missing references)168 //IL_0082: Unknown result type (might be due to invalid IL or missing references)169 //IL_0087: Unknown result type (might be due to invalid IL or missing references)170 //IL_008b: Unknown result type (might be due to invalid IL or missing references)171 //IL_0090: Unknown result type (might be due to invalid IL or missing references)172 //IL_003c: Unknown result type (might be due to invalid IL or missing references)173 //IL_00f3: Unknown result type (might be due to invalid IL or missing references)174 //IL_0102: Unknown result type (might be due to invalid IL or missing references)175 //IL_0107: Unknown result type (might be due to invalid IL or missing references)176 //IL_010b: Unknown result type (might be due to invalid IL or missing references)177 //IL_0110: Unknown result type (might be due to invalid IL or missing references)178 //IL_00a4: Unknown result type (might be due to invalid IL or missing references)179 //IL_00a5: Unknown result type (might be due to invalid IL or missing references)180 //IL_0124: Unknown result type (might be due to invalid IL or missing references)181 //IL_0125: Unknown result type (might be due to invalid IL or missing references)182 //IL_0180: Unknown result type (might be due to invalid IL or missing references)183 //IL_018f: Unknown result type (might be due to invalid IL or missing references)184 //IL_0194: Unknown result type (might be due to invalid IL or missing references)185 //IL_0198: Unknown result type (might be due to invalid IL or missing references)186 //IL_019d: Unknown result type (might be due to invalid IL or missing references)187 //IL_01b1: Unknown result type (might be due to invalid IL or missing references)188 //IL_01b2: Unknown result type (might be due to invalid IL or missing references)189 int num = _003C_003E1__state;190 TSBAccountDefLogic tSBAccountDefLogic = _003C_003E4__this;191 bool result;192 try193 {194 if ((uint)num > 2u)195 {196 if (string.IsNullOrWhiteSpace(uidPerson))197 {198 throw new ArgumentNullException("uidPerson");199 }200 if (string.IsNullOrWhiteSpace(uidTSBAccountDef))201 {202 throw new ArgumentNullException("uidTSBAccountDef");203 }204 _003C_003E7__wrap1 = tSBAccountDefLogic.StartInternalProcess();205 }206 try207 {208 ConfiguredValueTaskAwaiter<ApplyResult> val;209 switch (num)210 {211 default:212 val = entity.PutValueAsync("UID_Person", uidPerson, ct).ConfigureAwait(false).GetAwaiter();213 if (!val.IsCompleted)214 {215 num = (_003C_003E1__state = 0);216 _003C_003Eu__1 = val;217 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<ApplyResult>, _003CAssignAccountDef_003Ed__2>(ref val, ref this);218 return;219 }220 goto IL_00d9;221 case 0:222 val = _003C_003Eu__1;223 _003C_003Eu__1 = default(ConfiguredValueTaskAwaiter<ApplyResult>);224 num = (_003C_003E1__state = -1);225 goto IL_00d9;226 case 1:227 val = _003C_003Eu__1;228 _003C_003Eu__1 = default(ConfiguredValueTaskAwaiter<ApplyResult>);229 num = (_003C_003E1__state = -1);230 goto IL_0159;231 case 2:232 {233 val = _003C_003Eu__1;234 _003C_003Eu__1 = default(ConfiguredValueTaskAwaiter<ApplyResult>);235 num = (_003C_003E1__state = -1);236 break;237 }238 IL_0159:239 val.GetResult();240 if (!string.IsNullOrEmpty(uidTSBBehavior))241 {242 val = entity.TryPutValueAsync("UID_TSBBehavior", uidTSBBehavior, ct).ConfigureAwait(false).GetAwaiter();243 if (!val.IsCompleted)244 {245 num = (_003C_003E1__state = 2);246 _003C_003Eu__1 = val;247 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<ApplyResult>, _003CAssignAccountDef_003Ed__2>(ref val, ref this);248 return;249 }250 break;251 }252 goto end_IL_004f;253 IL_00d9:254 val.GetResult();255 val = entity.PutValueAsync("UID_TSBAccountDef", uidTSBAccountDef, ct).ConfigureAwait(false).GetAwaiter();256 if (!val.IsCompleted)257 {258 num = (_003C_003E1__state = 1);259 _003C_003Eu__1 = val;260 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<ApplyResult>, _003CAssignAccountDef_003Ed__2>(ref val, ref this);261 return;262 }263 goto IL_0159;264 }265 val.GetResult();266 end_IL_004f:;267 }268 finally269 {270 if (num < 0 && _003C_003E7__wrap1 != null)271 {272 _003C_003E7__wrap1.Dispose();273 }274 }275 _003C_003E7__wrap1 = null;276 result = true;277 }278 catch (System.Exception exception)279 {280 _003C_003E1__state = -2;281 _003C_003Et__builder.SetException(exception);282 return;283 }284 _003C_003E1__state = -2;285 _003C_003Et__builder.SetResult(result);286 }287288 [DebuggerHidden]289 private void SetStateMachine(IAsyncStateMachine stateMachine)290 {291 _003C_003Et__builder.SetStateMachine(stateMachine);292 }293 }294295 [StructLayout((LayoutKind)3)]296 [CompilerGenerated]297 private struct _003CAssignAccountDef_OnSaving_003Ed__3 : IAsyncStateMachine298 {299 public int _003C_003E1__state;300301 public AsyncTaskMethodBuilder _003C_003Et__builder;302303 public IEntity entity;304305 public LogicReadWriteParameters parameter;306307 public CancellationToken ct;308309 private _003C_003Ec__DisplayClass3_0 _003C_003E8__1;310311 private IEntity _003CePhA_003E5__2;312313 private ConfiguredTaskAwaiter<TryResult<IEntity>> _003C_003Eu__1;314315 private ConfiguredTaskAwaiter<IEntity> _003C_003Eu__2;316317 private ConfiguredValueTaskAwaiter<ApplyResult> _003C_003Eu__3;318319 private ConfiguredTaskAwaiter _003C_003Eu__4;320321 private void MoveNext()322 {323 //IL_00c5: Unknown result type (might be due to invalid IL or missing references)324 //IL_00ca: Unknown result type (might be due to invalid IL or missing references)325 //IL_00d1: Unknown result type (might be due to invalid IL or missing references)326 //IL_0161: Unknown result type (might be due to invalid IL or missing references)327 //IL_0166: Unknown result type (might be due to invalid IL or missing references)328 //IL_016e: Unknown result type (might be due to invalid IL or missing references)329 //IL_01fc: Unknown result type (might be due to invalid IL or missing references)330 //IL_0201: Unknown result type (might be due to invalid IL or missing references)331 //IL_0209: Unknown result type (might be due to invalid IL or missing references)332 //IL_028e: Unknown result type (might be due to invalid IL or missing references)333 //IL_0293: Unknown result type (might be due to invalid IL or missing references)334 //IL_029b: Unknown result type (might be due to invalid IL or missing references)335 //IL_0322: Unknown result type (might be due to invalid IL or missing references)336 //IL_0327: Unknown result type (might be due to invalid IL or missing references)337 //IL_032f: Unknown result type (might be due to invalid IL or missing references)338 //IL_03a5: Unknown result type (might be due to invalid IL or missing references)339 //IL_03aa: Unknown result type (might be due to invalid IL or missing references)340 //IL_03b2: Unknown result type (might be due to invalid IL or missing references)341 //IL_042e: Unknown result type (might be due to invalid IL or missing references)342 //IL_0433: Unknown result type (might be due to invalid IL or missing references)343 //IL_043b: Unknown result type (might be due to invalid IL or missing references)344 //IL_007e: Unknown result type (might be due to invalid IL or missing references)345 //IL_0089: Unknown result type (might be due to invalid IL or missing references)346 //IL_008e: Unknown result type (might be due to invalid IL or missing references)347 //IL_0092: Unknown result type (might be due to invalid IL or missing references)348 //IL_0097: Unknown result type (might be due to invalid IL or missing references)349 //IL_01af: Unknown result type (might be due to invalid IL or missing references)350 //IL_01be: Unknown result type (might be due to invalid IL or missing references)351 //IL_01c3: Unknown result type (might be due to invalid IL or missing references)352 //IL_01c7: Unknown result type (might be due to invalid IL or missing references)353 //IL_01cc: Unknown result type (might be due to invalid IL or missing references)354 //IL_0241: Unknown result type (might be due to invalid IL or missing references)355 //IL_0250: Unknown result type (might be due to invalid IL or missing references)356 //IL_0255: Unknown result type (might be due to invalid IL or missing references)357 //IL_0259: Unknown result type (might be due to invalid IL or missing references)358 //IL_025e: Unknown result type (might be due to invalid IL or missing references)359 //IL_0358: Unknown result type (might be due to invalid IL or missing references)360 //IL_0367: Unknown result type (might be due to invalid IL or missing references)361 //IL_036c: Unknown result type (might be due to invalid IL or missing references)362 //IL_0370: Unknown result type (might be due to invalid IL or missing references)363 //IL_0375: Unknown result type (might be due to invalid IL or missing references)364 //IL_00ab: Unknown result type (might be due to invalid IL or missing references)365 //IL_00ac: Unknown result type (might be due to invalid IL or missing references)366 //IL_0118: Unknown result type (might be due to invalid IL or missing references)367 //IL_0123: Unknown result type (might be due to invalid IL or missing references)368 //IL_0128: Unknown result type (might be due to invalid IL or missing references)369 //IL_012c: Unknown result type (might be due to invalid IL or missing references)370 //IL_0131: Unknown result type (might be due to invalid IL or missing references)371 //IL_01e1: Unknown result type (might be due to invalid IL or missing references)372 //IL_01e3: Unknown result type (might be due to invalid IL or missing references)373 //IL_0273: Unknown result type (might be due to invalid IL or missing references)374 //IL_0275: Unknown result type (might be due to invalid IL or missing references)375 //IL_02d5: Unknown result type (might be due to invalid IL or missing references)376 //IL_02e4: Unknown result type (might be due to invalid IL or missing references)377 //IL_02e9: Unknown result type (might be due to invalid IL or missing references)378 //IL_02ed: Unknown result type (might be due to invalid IL or missing references)379 //IL_02f2: Unknown result type (might be due to invalid IL or missing references)380 //IL_038a: Unknown result type (might be due to invalid IL or missing references)381 //IL_038c: Unknown result type (might be due to invalid IL or missing references)382 //IL_03e8: Unknown result type (might be due to invalid IL or missing references)383 //IL_03f3: Unknown result type (might be due to invalid IL or missing references)384 //IL_03f8: Unknown result type (might be due to invalid IL or missing references)385 //IL_03fc: Unknown result type (might be due to invalid IL or missing references)386 //IL_0401: Unknown result type (might be due to invalid IL or missing references)387 //IL_0146: Unknown result type (might be due to invalid IL or missing references)388 //IL_0148: Unknown result type (might be due to invalid IL or missing references)389 //IL_0307: Unknown result type (might be due to invalid IL or missing references)390 //IL_0309: Unknown result type (might be due to invalid IL or missing references)391 //IL_0416: Unknown result type (might be due to invalid IL or missing references)392 //IL_0418: Unknown result type (might be due to invalid IL or missing references)393 int num = _003C_003E1__state;394 try395 {396 ConfiguredTaskAwaiter<TryResult<IEntity>> val4;397 ConfiguredTaskAwaiter<IEntity> val3;398 ConfiguredValueTaskAwaiter<ApplyResult> val2;399 ConfiguredTaskAwaiter val;400 TryResult<IEntity> result;401 IEntity result2;402 switch (num)403 {404 default:405 {406 _003C_003E8__1 = new _003C_003Ec__DisplayClass3_0();407 _003C_003E8__1.entity = entity;408 Query query = (from c in Query.From("PersonHasTSBAccountDef")409 where c.Column("UID_TSBAccountDef") == _003C_003E8__1.entity.GetValue<string>("UID_TSBAccountDef") && c.Column("UID_Person") == _003C_003E8__1.entity.GetValue<string>("UID_Person")410 select c).GetQuery();411 val4 = parameter.Session.Source().TryGetAsync(query, EntityLoadType.DelayedLogic, ct).ConfigureAwait(false)412 .GetAwaiter();413 if (!val4.IsCompleted)414 {415 num = (_003C_003E1__state = 0);416 _003C_003Eu__1 = val4;417 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<TryResult<IEntity>>, _003CAssignAccountDef_OnSaving_003Ed__3>(ref val4, ref this);418 return;419 }420 goto IL_00e0;421 }422 case 0:423 val4 = _003C_003Eu__1;424 _003C_003Eu__1 = default(ConfiguredTaskAwaiter<TryResult<IEntity>>);425 num = (_003C_003E1__state = -1);426 goto IL_00e0;427 case 1:428 val3 = _003C_003Eu__2;429 _003C_003Eu__2 = default(ConfiguredTaskAwaiter<IEntity>);430 num = (_003C_003E1__state = -1);431 goto IL_017d;432 case 2:433 val2 = _003C_003Eu__3;434 _003C_003Eu__3 = default(ConfiguredValueTaskAwaiter<ApplyResult>);435 num = (_003C_003E1__state = -1);436 goto IL_0218;437 case 3:438 val2 = _003C_003Eu__3;439 _003C_003Eu__3 = default(ConfiguredValueTaskAwaiter<ApplyResult>);440 num = (_003C_003E1__state = -1);441 goto IL_02aa;442 case 4:443 val2 = _003C_003Eu__3;444 _003C_003Eu__3 = default(ConfiguredValueTaskAwaiter<ApplyResult>);445 num = (_003C_003E1__state = -1);446 goto IL_033e;447 case 5:448 val2 = _003C_003Eu__3;449 _003C_003Eu__3 = default(ConfiguredValueTaskAwaiter<ApplyResult>);450 num = (_003C_003E1__state = -1);451 goto IL_03c1;452 case 6:453 {454 val = _003C_003Eu__4;455 _003C_003Eu__4 = default(ConfiguredTaskAwaiter);456 num = (_003C_003E1__state = -1);457 break;458 }459 IL_0218:460 val2.GetResult();461 val2 = _003CePhA_003E5__2.PutValueAsync("UID_Person", _003C_003E8__1.entity.GetValue<string>("UID_Person"), ct).ConfigureAwait(false).GetAwaiter();462 if (!val2.IsCompleted)463 {464 num = (_003C_003E1__state = 3);465 _003C_003Eu__3 = val2;466 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<ApplyResult>, _003CAssignAccountDef_OnSaving_003Ed__3>(ref val2, ref this);467 return;468 }469 goto IL_02aa;470 IL_00e0:471 result = val4.GetResult();472 if (result.Success)473 {474 _003CePhA_003E5__2 = result.Result;475 goto IL_02b2;476 }477 val3 = parameter.Session.Source().CreateNewAsync("PersonHasTSBAccountDef", EntityCreationType.DelayedLogic, ct).ConfigureAwait(false)478 .GetAwaiter();479 if (!val3.IsCompleted)480 {481 num = (_003C_003E1__state = 1);482 _003C_003Eu__2 = val3;483 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntity>, _003CAssignAccountDef_OnSaving_003Ed__3>(ref val3, ref this);484 return;485 }486 goto IL_017d;487 IL_033e:488 val2.GetResult();489 val2 = _003CePhA_003E5__2.PutValueAsync("XIsInEffect", true, ct).ConfigureAwait(false).GetAwaiter();490 if (!val2.IsCompleted)491 {492 num = (_003C_003E1__state = 5);493 _003C_003Eu__3 = val2;494 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<ApplyResult>, _003CAssignAccountDef_OnSaving_003Ed__3>(ref val2, ref this);495 return;496 }497 goto IL_03c1;498 IL_02aa:499 val2.GetResult();500 goto IL_02b2;501 IL_02b2:502 val2 = _003CePhA_003E5__2.PutValueAsync("XOrigin", _003CePhA_003E5__2.GetValue<int>("XOrigin") | 1, ct).ConfigureAwait(false).GetAwaiter();503 if (!val2.IsCompleted)504 {505 num = (_003C_003E1__state = 4);506 _003C_003Eu__3 = val2;507 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<ApplyResult>, _003CAssignAccountDef_OnSaving_003Ed__3>(ref val2, ref this);508 return;509 }510 goto IL_033e;511 IL_017d:512 result2 = val3.GetResult();513 _003CePhA_003E5__2 = result2;514 val2 = _003CePhA_003E5__2.PutValueAsync("UID_TSBAccountDef", _003C_003E8__1.entity.GetValue<string>("UID_TSBAccountDef"), ct).ConfigureAwait(false).GetAwaiter();515 if (!val2.IsCompleted)516 {517 num = (_003C_003E1__state = 2);518 _003C_003Eu__3 = val2;519 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<ApplyResult>, _003CAssignAccountDef_OnSaving_003Ed__3>(ref val2, ref this);520 return;521 }522 goto IL_0218;523 IL_03c1:524 val2.GetResult();525 if (_003CePhA_003E5__2.IsChanged)526 {527 ConfiguredTaskAwaitable val5 = parameter.UnitOfWork.PutAsync(_003CePhA_003E5__2, ct).ConfigureAwait(false);528 val = ((ConfiguredTaskAwaitable)(ref val5)).GetAwaiter();529 if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)530 {531 num = (_003C_003E1__state = 6);532 _003C_003Eu__4 = val;533 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003CAssignAccountDef_OnSaving_003Ed__3>(ref val, ref this);534 return;535 }536 break;537 }538 goto end_IL_0007;539 }540 ((ConfiguredTaskAwaiter)(ref val)).GetResult();541 end_IL_0007:;542 }543 catch (System.Exception exception)544 {545 _003C_003E1__state = -2;546 _003C_003E8__1 = null;547 _003CePhA_003E5__2 = null;548 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);549 return;550 }551 _003C_003E1__state = -2;552 _003C_003E8__1 = null;553 _003CePhA_003E5__2 = null;554 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();555 }556557 [DebuggerHidden]558 private void SetStateMachine(IAsyncStateMachine stateMachine)559 {560 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);561 }562 }563564 [StructLayout((LayoutKind)3)]565 [CompilerGenerated]566 private struct _003CCheckPersonHasTSBAccountDef_003Ed__9 : IAsyncStateMachine567 {568 public int _003C_003E1__state;569570 public AsyncTaskMethodBuilder _003C_003Et__builder;571572 public IEntity entity;573574 public ISession session;575576 public CancellationToken ct;577578 private _003C_003Ec__DisplayClass9_0 _003C_003E8__1;579580 public IUnitOfWork uow;581582 private ConfiguredTaskAwaiter<TryResult<IEntity>> _003C_003Eu__1;583584 private IEntity _003CePhA_003E5__2;585586 private ConfiguredTaskAwaiter<IEntity> _003C_003Eu__2;587588 private ConfiguredValueTaskAwaiter<ApplyResult> _003C_003Eu__3;589590 private ConfiguredTaskAwaiter _003C_003Eu__4;591592 private void MoveNext()593 {594 //IL_015a: Unknown result type (might be due to invalid IL or missing references)595 //IL_015f: Unknown result type (might be due to invalid IL or missing references)596 //IL_0166: Unknown result type (might be due to invalid IL or missing references)597 //IL_027a: Unknown result type (might be due to invalid IL or missing references)598 //IL_027f: Unknown result type (might be due to invalid IL or missing references)599 //IL_0287: Unknown result type (might be due to invalid IL or missing references)600 //IL_030b: Unknown result type (might be due to invalid IL or missing references)601 //IL_0310: Unknown result type (might be due to invalid IL or missing references)602 //IL_0318: Unknown result type (might be due to invalid IL or missing references)603 //IL_0393: Unknown result type (might be due to invalid IL or missing references)604 //IL_0398: Unknown result type (might be due to invalid IL or missing references)605 //IL_03a0: Unknown result type (might be due to invalid IL or missing references)606 //IL_0416: Unknown result type (might be due to invalid IL or missing references)607 //IL_041b: Unknown result type (might be due to invalid IL or missing references)608 //IL_0423: Unknown result type (might be due to invalid IL or missing references)609 //IL_048d: Unknown result type (might be due to invalid IL or missing references)610 //IL_0492: Unknown result type (might be due to invalid IL or missing references)611 //IL_049a: Unknown result type (might be due to invalid IL or missing references)612 //IL_02be: Unknown result type (might be due to invalid IL or missing references)613 //IL_02cd: Unknown result type (might be due to invalid IL or missing references)614 //IL_02d2: Unknown result type (might be due to invalid IL or missing references)615 //IL_02d6: Unknown result type (might be due to invalid IL or missing references)616 //IL_02db: Unknown result type (might be due to invalid IL or missing references)617 //IL_0346: Unknown result type (might be due to invalid IL or missing references)618 //IL_0355: Unknown result type (might be due to invalid IL or missing references)619 //IL_035a: Unknown result type (might be due to invalid IL or missing references)620 //IL_035e: Unknown result type (might be due to invalid IL or missing references)621 //IL_0363: Unknown result type (might be due to invalid IL or missing references)622 //IL_03c9: Unknown result type (might be due to invalid IL or missing references)623 //IL_03d8: Unknown result type (might be due to invalid IL or missing references)624 //IL_03dd: Unknown result type (might be due to invalid IL or missing references)625 //IL_03e1: Unknown result type (might be due to invalid IL or missing references)626 //IL_03e6: Unknown result type (might be due to invalid IL or missing references)627 //IL_0447: Unknown result type (might be due to invalid IL or missing references)628 //IL_0452: Unknown result type (might be due to invalid IL or missing references)629 //IL_0457: Unknown result type (might be due to invalid IL or missing references)630 //IL_045b: Unknown result type (might be due to invalid IL or missing references)631 //IL_0460: Unknown result type (might be due to invalid IL or missing references)632 //IL_02f0: Unknown result type (might be due to invalid IL or missing references)633 //IL_02f2: Unknown result type (might be due to invalid IL or missing references)634 //IL_0378: Unknown result type (might be due to invalid IL or missing references)635 //IL_037a: Unknown result type (might be due to invalid IL or missing references)636 //IL_03fb: Unknown result type (might be due to invalid IL or missing references)637 //IL_03fd: Unknown result type (might be due to invalid IL or missing references)638 //IL_0475: Unknown result type (might be due to invalid IL or missing references)639 //IL_0477: Unknown result type (might be due to invalid IL or missing references)640 //IL_0231: Unknown result type (might be due to invalid IL or missing references)641 //IL_023c: Unknown result type (might be due to invalid IL or missing references)642 //IL_0241: Unknown result type (might be due to invalid IL or missing references)643 //IL_0245: Unknown result type (might be due to invalid IL or missing references)644 //IL_024a: Unknown result type (might be due to invalid IL or missing references)645 //IL_0113: Unknown result type (might be due to invalid IL or missing references)646 //IL_011e: Unknown result type (might be due to invalid IL or missing references)647 //IL_0123: Unknown result type (might be due to invalid IL or missing references)648 //IL_0127: Unknown result type (might be due to invalid IL or missing references)649 //IL_012c: Unknown result type (might be due to invalid IL or missing references)650 //IL_025f: Unknown result type (might be due to invalid IL or missing references)651 //IL_0261: Unknown result type (might be due to invalid IL or missing references)652 //IL_0140: Unknown result type (might be due to invalid IL or missing references)653 //IL_0141: Unknown result type (might be due to invalid IL or missing references)654 int num = _003C_003E1__state;655 try656 {657 ConfiguredTaskAwaiter<TryResult<IEntity>> val4;658 ConfiguredTaskAwaiter<IEntity> val3;659 ConfiguredValueTaskAwaiter<ApplyResult> val2;660 ConfiguredTaskAwaiter val;661 ConfiguredTaskAwaitable val5;662 TryResult<IEntity> result;663 IEntity result2;664 switch (num)665 {666 default:667 _003C_003E8__1 = new _003C_003Ec__DisplayClass9_0();668 if (entity.Columns.ChangedAny("UID_TSBAccountDef", "UID_Person") || entity.IsDeleted())669 {670 _003C_003E8__1.uidTSBAccountDef = entity.GetValue<string>("UID_TSBAccountDef");671 _003C_003E8__1.uidPerson = entity.GetValue<string>("UID_Person");672 if (!string.IsNullOrEmpty(_003C_003E8__1.uidTSBAccountDef) && !string.IsNullOrEmpty(_003C_003E8__1.uidPerson))673 {674 Query query = (from c in Query.From("PersonHasTSBAccountDef")675 where c.Column("UID_TSBAccountDef") == _003C_003E8__1.uidTSBAccountDef && c.Column("UID_Person") == _003C_003E8__1.uidPerson676 select c).Select("XIsInEffect", "XOrigin");677 val4 = session.Source().TryGetAsync(query, EntityLoadType.ReadOnly, ct).ConfigureAwait(false)678 .GetAwaiter();679 if (!val4.IsCompleted)680 {681 num = (_003C_003E1__state = 0);682 _003C_003Eu__1 = val4;683 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<TryResult<IEntity>>, _003CCheckPersonHasTSBAccountDef_003Ed__9>(ref val4, ref this);684 return;685 }686 goto IL_0175;687 }688 }689 goto end_IL_0007;690 case 0:691 val4 = _003C_003Eu__1;692 _003C_003Eu__1 = default(ConfiguredTaskAwaiter<TryResult<IEntity>>);693 num = (_003C_003E1__state = -1);694 goto IL_0175;695 case 1:696 val3 = _003C_003Eu__2;697 _003C_003Eu__2 = default(ConfiguredTaskAwaiter<IEntity>);698 num = (_003C_003E1__state = -1);699 goto IL_0296;700 case 2:701 val2 = _003C_003Eu__3;702 _003C_003Eu__3 = default(ConfiguredValueTaskAwaiter<ApplyResult>);703 num = (_003C_003E1__state = -1);704 goto IL_0327;705 case 3:706 val2 = _003C_003Eu__3;707 _003C_003Eu__3 = default(ConfiguredValueTaskAwaiter<ApplyResult>);708 num = (_003C_003E1__state = -1);709 goto IL_03af;710 case 4:711 val2 = _003C_003Eu__3;712 _003C_003Eu__3 = default(ConfiguredValueTaskAwaiter<ApplyResult>);713 num = (_003C_003E1__state = -1);714 goto IL_0432;715 case 5:716 {717 val = _003C_003Eu__4;718 _003C_003Eu__4 = default(ConfiguredTaskAwaiter);719 num = (_003C_003E1__state = -1);720 break;721 }722 IL_0432:723 val2.GetResult();724 val5 = uow.PutAsync(_003CePhA_003E5__2, ct).ConfigureAwait(false);725 val = ((ConfiguredTaskAwaitable)(ref val5)).GetAwaiter();726 if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)727 {728 num = (_003C_003E1__state = 5);729 _003C_003Eu__4 = val;730 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003CCheckPersonHasTSBAccountDef_003Ed__9>(ref val, ref this);731 return;732 }733 break;734 IL_0175:735 result = val4.GetResult();736 if (result.Success)737 {738 bool value = result.Result.GetValue<bool>("XIsInEffect");739 int value2 = result.Result.GetValue<int>("XOrigin");740 if (entity.IsDeleted() && value && value2 > 0)741 {742 throw new ViException(2088510, ExceptionRelevance.EndUser);743 }744 if (!entity.IsDeleted() && !value && entity.Columns["UID_TSBAccountDef"].IsChanged)745 {746 throw new ViException(2088518, ExceptionRelevance.EndUser);747 }748 }749 else if (!entity.IsDeleted())750 {751 val3 = session.Source().CreateNewAsync("PersonHasTSBAccountDef", EntityCreationType.DelayedLogic, ct).ConfigureAwait(false)752 .GetAwaiter();753 if (!val3.IsCompleted)754 {755 num = (_003C_003E1__state = 1);756 _003C_003Eu__2 = val3;757 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntity>, _003CCheckPersonHasTSBAccountDef_003Ed__9>(ref val3, ref this);758 return;759 }760 goto IL_0296;761 }762 goto end_IL_0007;763 IL_0296:764 result2 = val3.GetResult();765 _003CePhA_003E5__2 = result2;766 val2 = _003CePhA_003E5__2.PutValueAsync("UID_Person", _003C_003E8__1.uidPerson, ct).ConfigureAwait(false).GetAwaiter();767 if (!val2.IsCompleted)768 {769 num = (_003C_003E1__state = 2);770 _003C_003Eu__3 = val2;771 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<ApplyResult>, _003CCheckPersonHasTSBAccountDef_003Ed__9>(ref val2, ref this);772 return;773 }774 goto IL_0327;775 IL_0327:776 val2.GetResult();777 val2 = _003CePhA_003E5__2.PutValueAsync("UID_TSBAccountDef", _003C_003E8__1.uidTSBAccountDef, ct).ConfigureAwait(false).GetAwaiter();778 if (!val2.IsCompleted)779 {780 num = (_003C_003E1__state = 3);781 _003C_003Eu__3 = val2;782 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<ApplyResult>, _003CCheckPersonHasTSBAccountDef_003Ed__9>(ref val2, ref this);783 return;784 }785 goto IL_03af;786 IL_03af:787 val2.GetResult();788 val2 = _003CePhA_003E5__2.PutValueAsync("XIsInEffect", true, ct).ConfigureAwait(false).GetAwaiter();789 if (!val2.IsCompleted)790 {791 num = (_003C_003E1__state = 4);792 _003C_003Eu__3 = val2;793 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<ApplyResult>, _003CCheckPersonHasTSBAccountDef_003Ed__9>(ref val2, ref this);794 return;795 }796 goto IL_0432;797 }798 ((ConfiguredTaskAwaiter)(ref val)).GetResult();799 _003CePhA_003E5__2 = null;800 end_IL_0007:;801 }802 catch (System.Exception exception)803 {804 _003C_003E1__state = -2;805 _003C_003E8__1 = null;806 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);807 return;808 }809 _003C_003E1__state = -2;810 _003C_003E8__1 = null;811 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();812 }813814 [DebuggerHidden]815 private void SetStateMachine(IAsyncStateMachine stateMachine)816 {817 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);818 }819 }820821 [StructLayout((LayoutKind)3)]822 [CompilerGenerated]823 private struct _003CCheckTSBBahavior_003Ed__10 : IAsyncStateMachine824 {825 public int _003C_003E1__state;826827 public AsyncTaskMethodBuilder _003C_003Et__builder;828829 public string uidTsbAccountDef;830831 public IEntity entity;832833 public ISession session;834835 public CancellationToken ct;836837 private ConfiguredTaskAwaiter<bool> _003C_003Eu__1;838839 private void MoveNext()840 {841 //IL_00f6: Unknown result type (might be due to invalid IL or missing references)842 //IL_00fb: Unknown result type (might be due to invalid IL or missing references)843 //IL_0102: Unknown result type (might be due to invalid IL or missing references)844 //IL_00b2: Unknown result type (might be due to invalid IL or missing references)845 //IL_00bd: Unknown result type (might be due to invalid IL or missing references)846 //IL_00c2: Unknown result type (might be due to invalid IL or missing references)847 //IL_00c6: Unknown result type (might be due to invalid IL or missing references)848 //IL_00cb: Unknown result type (might be due to invalid IL or missing references)849 //IL_00df: Unknown result type (might be due to invalid IL or missing references)850 //IL_00e0: Unknown result type (might be due to invalid IL or missing references)851 int num = _003C_003E1__state;852 try853 {854 ConfiguredTaskAwaiter<bool> val;855 if (num == 0)856 {857 val = _003C_003Eu__1;858 _003C_003Eu__1 = default(ConfiguredTaskAwaiter<bool>);859 num = (_003C_003E1__state = -1);860 goto IL_0111;861 }862 _003C_003Ec__DisplayClass10_0 CS_0024_003C_003E8__locals4 = new _003C_003Ec__DisplayClass10_0863 {864 uidTsbAccountDef = uidTsbAccountDef865 };866 if (entity.Columns["UID_TSBAccountDef"].IsChanged || entity.Columns["UID_TSBBehavior"].IsChanged)867 {868 CS_0024_003C_003E8__locals4.uidTSBBehavior = entity.GetValue<string>("UID_TSBBehavior");869 if (!string.IsNullOrEmpty(CS_0024_003C_003E8__locals4.uidTSBBehavior))870 {871 Query query = (from c in Query.From("TSBAccountDefHasBehavior")872 where c.Column("UID_TSBAccountDef") == CS_0024_003C_003E8__locals4.uidTsbAccountDef && c.Column("UID_TSBBehavior") == CS_0024_003C_003E8__locals4.uidTSBBehavior873 select c).GetQuery();874 val = session.Source().ExistsAsync(query, ct).ConfigureAwait(false)875 .GetAwaiter();876 if (!val.IsCompleted)877 {878 num = (_003C_003E1__state = 0);879 _003C_003Eu__1 = val;880 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<bool>, _003CCheckTSBBahavior_003Ed__10>(ref val, ref this);881 return;882 }883 goto IL_0111;884 }885 }886 goto end_IL_0007;887 IL_0111:888 if (!val.GetResult())889 {890 throw new ViException(2088502, ExceptionRelevance.EndUser);891 }892 end_IL_0007:;893 }894 catch (System.Exception exception)895 {896 _003C_003E1__state = -2;897 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);898 return;899 }900 _003C_003E1__state = -2;901 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();902 }903904 [DebuggerHidden]905 private void SetStateMachine(IAsyncStateMachine stateMachine)906 {907 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);908 }909 }910911 [StructLayout((LayoutKind)3)]912 [CompilerGenerated]913 private struct _003CCheckUniqueAccount_003Ed__11 : IAsyncStateMachine914 {915 public int _003C_003E1__state;916917 public AsyncTaskMethodBuilder _003C_003Et__builder;918919 public string uidTsbAccountDef;920921 public IEntity entity;922923 public ISession session;924925 public CancellationToken ct;926927 private _003C_003Ec__DisplayClass11_1 _003C_003E8__1;928929 private ISelect _003CsAccount_003E5__2;930931 private ConfiguredTaskAwaiter<IMetaTable> _003C_003Eu__1;932933 private ConfiguredTaskAwaiter<TryResult<IEntity>> _003C_003Eu__2;934935 private void MoveNext()936 {937 //IL_0133: Unknown result type (might be due to invalid IL or missing references)938 //IL_0138: Unknown result type (might be due to invalid IL or missing references)939 //IL_0140: Unknown result type (might be due to invalid IL or missing references)940 //IL_01fd: Unknown result type (might be due to invalid IL or missing references)941 //IL_0202: Unknown result type (might be due to invalid IL or missing references)942 //IL_020a: Unknown result type (might be due to invalid IL or missing references)943 //IL_01b4: Unknown result type (might be due to invalid IL or missing references)944 //IL_01bf: Unknown result type (might be due to invalid IL or missing references)945 //IL_01c4: Unknown result type (might be due to invalid IL or missing references)946 //IL_01c8: Unknown result type (might be due to invalid IL or missing references)947 //IL_01cd: Unknown result type (might be due to invalid IL or missing references)948 //IL_01e2: Unknown result type (might be due to invalid IL or missing references)949 //IL_01e4: Unknown result type (might be due to invalid IL or missing references)950 //IL_00ea: Unknown result type (might be due to invalid IL or missing references)951 //IL_00f5: Unknown result type (might be due to invalid IL or missing references)952 //IL_00fa: Unknown result type (might be due to invalid IL or missing references)953 //IL_00fe: Unknown result type (might be due to invalid IL or missing references)954 //IL_0103: Unknown result type (might be due to invalid IL or missing references)955 //IL_0118: Unknown result type (might be due to invalid IL or missing references)956 //IL_011a: Unknown result type (might be due to invalid IL or missing references)957 int num = _003C_003E1__state;958 try959 {960 ConfiguredTaskAwaiter<IMetaTable> val;961 if (num == 0)962 {963 val = _003C_003Eu__1;964 _003C_003Eu__1 = default(ConfiguredTaskAwaiter<IMetaTable>);965 num = (_003C_003E1__state = -1);966 goto IL_014f;967 }968 ConfiguredTaskAwaiter<TryResult<IEntity>> val2;969 if (num == 1)970 {971 val2 = _003C_003Eu__2;972 _003C_003Eu__2 = default(ConfiguredTaskAwaiter<TryResult<IEntity>>);973 num = (_003C_003E1__state = -1);974 goto IL_0219;975 }976 _003C_003Ec__DisplayClass11_0 CS_0024_003C_003E8__locals9 = new _003C_003Ec__DisplayClass11_0977 {978 uidTsbAccountDef = uidTsbAccountDef,979 entity = entity980 };981 if (CS_0024_003C_003E8__locals9.entity.Columns["UID_TSBAccountDef"].IsChanged)982 {983 CS_0024_003C_003E8__locals9.uidPerson = CS_0024_003C_003E8__locals9.entity.GetValue<string>("UID_Person");984 if (!string.IsNullOrEmpty(CS_0024_003C_003E8__locals9.uidTsbAccountDef))985 {986 _003CsAccount_003E5__2 = from c in Query.From(CS_0024_003C_003E8__locals9.entity.Tablename)987 where c.Column("UID_TSBAccountDef") == CS_0024_003C_003E8__locals9.uidTsbAccountDef && c.Column("UID_Person") == CS_0024_003C_003E8__locals9.uidPerson988 select c;989 if (CS_0024_003C_003E8__locals9.entity.IsLoaded)990 {991 _003C_003E8__1 = new _003C_003Ec__DisplayClass11_1();992 _003C_003E8__1.CS_0024_003C_003E8__locals1 = CS_0024_003C_003E8__locals9;993 val = session.MetaData().GetTableAsync(_003C_003E8__1.CS_0024_003C_003E8__locals1.entity.Tablename, ct).ConfigureAwait(false)994 .GetAwaiter();995 if (!val.IsCompleted)996 {997 num = (_003C_003E1__state = 0);998 _003C_003Eu__1 = val;999 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IMetaTable>, _003CCheckUniqueAccount_003Ed__11>(ref val, ref this);1000 return;1001 }1002 goto IL_014f;1003 }1004 goto IL_019c;1005 }1006 }1007 goto end_IL_0007;1008 IL_014f:1009 IMetaTable result = val.GetResult();1010 _003C_003E8__1.strPk = result.PrimaryKeyColumns[0].Columnname;1011 _003CsAccount_003E5__2 = _003CsAccount_003E5__2.Where((IExpressionContext c) => c.Column(_003C_003E8__1.strPk) != _003C_003E8__1.CS_0024_003C_003E8__locals1.entity.GetValue<string>(_003C_003E8__1.strPk));1012 _003C_003E8__1 = null;1013 goto IL_019c;1014 IL_019c:1015 val2 = session.Source().TryGetAsync(_003CsAccount_003E5__2.SelectDisplays(), EntityLoadType.DelayedLogic, ct).ConfigureAwait(false)1016 .GetAwaiter();1017 if (!val2.IsCompleted)1018 {1019 num = (_003C_003E1__state = 1);1020 _003C_003Eu__2 = val2;1021 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<TryResult<IEntity>>, _003CCheckUniqueAccount_003Ed__11>(ref val2, ref this);1022 return;1023 }1024 goto IL_0219;1025 IL_0219:1026 TryResult<IEntity> result2 = val2.GetResult();1027 if (result2.Success)1028 {1029 throw new ViException(2088503, ExceptionRelevance.EndUser, result2.Result.Display);1030 }1031 end_IL_0007:;1032 }1033 catch (System.Exception exception)1034 {1035 _003C_003E1__state = -2;1036 _003CsAccount_003E5__2 = null;1037 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);1038 return;1039 }1040 _003C_003E1__state = -2;1041 _003CsAccount_003E5__2 = null;1042 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();1043 }10441045 [DebuggerHidden]1046 private void SetStateMachine(IAsyncStateMachine stateMachine)1047 {1048 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);1049 }1050 }10511052 [StructLayout((LayoutKind)3)]1053 [CompilerGenerated]1054 private struct _003CExistsPersonHasTSBAccountDef_003Ed__1 : IAsyncStateMachine1055 {1056 public int _003C_003E1__state;10571058 public AsyncTaskMethodBuilder<bool> _003C_003Et__builder;10591060 public IEntity entity;10611062 public ISession session;10631064 public CancellationToken ct;10651066 private ConfiguredTaskAwaiter<bool> _003C_003Eu__1;10671068 private void MoveNext()1069 {1070 //IL_00b3: Unknown result type (might be due to invalid IL or missing references)1071 //IL_00b8: Unknown result type (might be due to invalid IL or missing references)1072 //IL_00c0: Unknown result type (might be due to invalid IL or missing references)1073 //IL_006d: Unknown result type (might be due to invalid IL or missing references)1074 //IL_0078: Unknown result type (might be due to invalid IL or missing references)1075 //IL_007d: Unknown result type (might be due to invalid IL or missing references)1076 //IL_0081: Unknown result type (might be due to invalid IL or missing references)1077 //IL_0086: Unknown result type (might be due to invalid IL or missing references)1078 //IL_009b: Unknown result type (might be due to invalid IL or missing references)1079 //IL_009d: Unknown result type (might be due to invalid IL or missing references)1080 int num = _003C_003E1__state;1081 bool result;1082 try1083 {1084 ConfiguredTaskAwaiter<bool> val;1085 if (num != 0)1086 {1087 _003C_003Ec__DisplayClass1_0 CS_0024_003C_003E8__locals2 = new _003C_003Ec__DisplayClass1_01088 {1089 uidTSBAccountDef = entity.GetValue<string>("UID_TSBAccountDef"),1090 uidPerson = entity.GetValue<string>("UID_Person")1091 };1092 Query query = (from c in Query.From("PersonHasTSBAccountDef")1093 where c.Column("UID_TSBAccountDef") == CS_0024_003C_003E8__locals2.uidTSBAccountDef && c.Column("UID_Person") == CS_0024_003C_003E8__locals2.uidPerson && c.Column("XIsInEffect") == true1094 select c).GetQuery();1095 val = session.Source().ExistsAsync(query, ct).ConfigureAwait(false)1096 .GetAwaiter();1097 if (!val.IsCompleted)1098 {1099 num = (_003C_003E1__state = 0);1100 _003C_003Eu__1 = val;1101 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<bool>, _003CExistsPersonHasTSBAccountDef_003Ed__1>(ref val, ref this);1102 return;1103 }1104 }1105 else1106 {1107 val = _003C_003Eu__1;1108 _003C_003Eu__1 = default(ConfiguredTaskAwaiter<bool>);1109 num = (_003C_003E1__state = -1);1110 }1111 result = val.GetResult();1112 }1113 catch (System.Exception exception)1114 {1115 _003C_003E1__state = -2;1116 _003C_003Et__builder.SetException(exception);1117 return;1118 }1119 _003C_003E1__state = -2;1120 _003C_003Et__builder.SetResult(result);1121 }11221123 [DebuggerHidden]1124 private void SetStateMachine(IAsyncStateMachine stateMachine)1125 {1126 _003C_003Et__builder.SetStateMachine(stateMachine);1127 }1128 }11291130 [StructLayout((LayoutKind)3)]1131 [CompilerGenerated]1132 private struct _003CGetLocalDependenciesAsync_003Ed__6 : IAsyncStateMachine1133 {1134 public int _003C_003E1__state;11351136 public AsyncTaskMethodBuilder<Bow<string>[]> _003C_003Et__builder;11371138 public TSBAccountDefLogic _003C_003E4__this;11391140 public IMetaTable table;11411142 public CancellationToken cancellationToken;11431144 private ConfiguredTaskAwaiter<Bow<string>[]> _003C_003Eu__1;11451146 private void MoveNext()1147 {1148 //IL_005d: Unknown result type (might be due to invalid IL or missing references)1149 //IL_0062: Unknown result type (might be due to invalid IL or missing references)1150 //IL_0069: Unknown result type (might be due to invalid IL or missing references)1151 //IL_0019: Unknown result type (might be due to invalid IL or missing references)1152 //IL_0024: Unknown result type (might be due to invalid IL or missing references)1153 //IL_0029: Unknown result type (might be due to invalid IL or missing references)1154 //IL_002d: Unknown result type (might be due to invalid IL or missing references)1155 //IL_0032: Unknown result type (might be due to invalid IL or missing references)1156 //IL_0046: Unknown result type (might be due to invalid IL or missing references)1157 //IL_0047: Unknown result type (might be due to invalid IL or missing references)1158 int num = _003C_003E1__state;1159 TSBAccountDefLogic tSBAccountDefLogic = _003C_003E4__this;1160 Bow<string>[] result;1161 try1162 {1163 ConfiguredTaskAwaiter<Bow<string>[]> val;1164 if (num != 0)1165 {1166 val = ((StateLessEntityLogic)tSBAccountDefLogic).GetLocalDependenciesAsync(table, cancellationToken).ConfigureAwait(false).GetAwaiter();1167 if (!val.IsCompleted)1168 {1169 num = (_003C_003E1__state = 0);1170 _003C_003Eu__1 = val;1171 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<Bow<string>[]>, _003CGetLocalDependenciesAsync_003Ed__6>(ref val, ref this);1172 return;1173 }1174 }1175 else1176 {1177 val = _003C_003Eu__1;1178 _003C_003Eu__1 = default(ConfiguredTaskAwaiter<Bow<string>[]>);1179 num = (_003C_003E1__state = -1);1180 }1181 result = Enumerable.Where<Bow<string>>((System.Collections.Generic.IEnumerable<Bow<string>>)val.GetResult(), (Func<Bow<string>, bool>)((Bow<string> b) => b.To != "UID_Person" || b.From != "UID_TSBAccountDef")).ToArraySmart();1182 }1183 catch (System.Exception exception)1184 {1185 _003C_003E1__state = -2;1186 _003C_003Et__builder.SetException(exception);1187 return;1188 }1189 _003C_003E1__state = -2;1190 _003C_003Et__builder.SetResult(result);1191 }11921193 [DebuggerHidden]1194 private void SetStateMachine(IAsyncStateMachine stateMachine)1195 {1196 _003C_003Et__builder.SetStateMachine(stateMachine);1197 }1198 }11991200 [StructLayout((LayoutKind)3)]1201 [CompilerGenerated]1202 private struct _003COnSavedAsync_003Ed__8 : IAsyncStateMachine1203 {1204 public int _003C_003E1__state;12051206 public AsyncTaskMethodBuilder _003C_003Et__builder;12071208 public IEntity entity;12091210 public LogicReadWriteParameters parameters;12111212 public CancellationToken ct;12131214 private _003C_003Ec__DisplayClass8_0 _003C_003E8__1;12151216 public TSBAccountDefLogic _003C_003E4__this;12171218 private ConfiguredTaskAwaiter<DbObjectKey> _003C_003Eu__1;12191220 private ConfiguredTaskAwaiter<IEntityCollection> _003C_003Eu__2;12211222 private System.Collections.Generic.IEnumerator<IEntity> _003C_003E7__wrap1;12231224 private ConfiguredTaskAwaiter _003C_003Eu__3;12251226 private void MoveNext()1227 {1228 //IL_011b: Unknown result type (might be due to invalid IL or missing references)1229 //IL_0120: Unknown result type (might be due to invalid IL or missing references)1230 //IL_0128: Unknown result type (might be due to invalid IL or missing references)1231 //IL_01cf: Unknown result type (might be due to invalid IL or missing references)1232 //IL_01d4: Unknown result type (might be due to invalid IL or missing references)1233 //IL_01dc: Unknown result type (might be due to invalid IL or missing references)1234 //IL_0325: Unknown result type (might be due to invalid IL or missing references)1235 //IL_032a: Unknown result type (might be due to invalid IL or missing references)1236 //IL_0332: Unknown result type (might be due to invalid IL or missing references)1237 //IL_0186: Unknown result type (might be due to invalid IL or missing references)1238 //IL_0191: Unknown result type (might be due to invalid IL or missing references)1239 //IL_0196: Unknown result type (might be due to invalid IL or missing references)1240 //IL_019a: Unknown result type (might be due to invalid IL or missing references)1241 //IL_019f: Unknown result type (might be due to invalid IL or missing references)1242 //IL_02df: Unknown result type (might be due to invalid IL or missing references)1243 //IL_02ea: Unknown result type (might be due to invalid IL or missing references)1244 //IL_02ef: Unknown result type (might be due to invalid IL or missing references)1245 //IL_02f3: Unknown result type (might be due to invalid IL or missing references)1246 //IL_02f8: Unknown result type (might be due to invalid IL or missing references)1247 //IL_01b4: Unknown result type (might be due to invalid IL or missing references)1248 //IL_01b6: Unknown result type (might be due to invalid IL or missing references)1249 //IL_0276: Unknown result type (might be due to invalid IL or missing references)1250 //IL_027b: Unknown result type (might be due to invalid IL or missing references)1251 //IL_0283: Unknown result type (might be due to invalid IL or missing references)1252 //IL_030d: Unknown result type (might be due to invalid IL or missing references)1253 //IL_030f: Unknown result type (might be due to invalid IL or missing references)1254 //IL_022d: Unknown result type (might be due to invalid IL or missing references)1255 //IL_0238: Unknown result type (might be due to invalid IL or missing references)1256 //IL_023d: Unknown result type (might be due to invalid IL or missing references)1257 //IL_0241: Unknown result type (might be due to invalid IL or missing references)1258 //IL_0246: Unknown result type (might be due to invalid IL or missing references)1259 //IL_025b: Unknown result type (might be due to invalid IL or missing references)1260 //IL_025d: Unknown result type (might be due to invalid IL or missing references)1261 //IL_00d2: Unknown result type (might be due to invalid IL or missing references)1262 //IL_00dd: Unknown result type (might be due to invalid IL or missing references)1263 //IL_00e2: Unknown result type (might be due to invalid IL or missing references)1264 //IL_00e6: Unknown result type (might be due to invalid IL or missing references)1265 //IL_00eb: Unknown result type (might be due to invalid IL or missing references)1266 //IL_0100: Unknown result type (might be due to invalid IL or missing references)1267 //IL_0102: Unknown result type (might be due to invalid IL or missing references)1268 int num = _003C_003E1__state;1269 TSBAccountDefLogic tSBAccountDefLogic = _003C_003E4__this;1270 try1271 {1272 ConfiguredTaskAwaiter<DbObjectKey> val3;1273 ConfiguredTaskAwaiter<IEntityCollection> val2;1274 ConfiguredTaskAwaiter val;1275 ConfiguredTaskAwaitable val4;1276 IEntityCollection result;1277 DbObjectKey result2;1278 Query query;1279 switch (num)1280 {1281 default:1282 if (entity.Contains("IdentityType") && !parameters.Session.IsFullSync() && !parameters.Session.IsTransport())1283 {1284 IEntityColumn entityColumn = entity.Columns["IdentityType"];1285 if (entityColumn.IsDifferent && string.Equals(entityColumn.GetOldValue<string>(), "Shared", (StringComparison)5) && !string.Equals(entityColumn.GetValue<string>(), "Shared", (StringComparison)5))1286 {1287 _003C_003E8__1 = new _003C_003Ec__DisplayClass8_0();1288 val3 = DbObjectKey.CreateAsync(parameters.Session.MetaData(), entity, ct).ConfigureAwait(false).GetAwaiter();1289 if (!val3.IsCompleted)1290 {1291 num = (_003C_003E1__state = 0);1292 _003C_003Eu__1 = val3;1293 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<DbObjectKey>, _003COnSavedAsync_003Ed__8>(ref val3, ref this);1294 return;1295 }1296 goto IL_0137;1297 }1298 }1299 goto IL_02d1;1300 case 0:1301 val3 = _003C_003Eu__1;1302 _003C_003Eu__1 = default(ConfiguredTaskAwaiter<DbObjectKey>);1303 num = (_003C_003E1__state = -1);1304 goto IL_0137;1305 case 1:1306 val2 = _003C_003Eu__2;1307 _003C_003Eu__2 = default(ConfiguredTaskAwaiter<IEntityCollection>);1308 num = (_003C_003E1__state = -1);1309 goto IL_01eb;1310 case 2:1311 try1312 {1313 if (num != 2)1314 {1315 goto IL_0299;1316 }1317 val = _003C_003Eu__3;1318 _003C_003Eu__3 = default(ConfiguredTaskAwaiter);1319 num = (_003C_003E1__state = -1);1320 goto IL_0292;1321 IL_0292:1322 ((ConfiguredTaskAwaiter)(ref val)).GetResult();1323 goto IL_0299;1324 IL_0299:1325 if (((System.Collections.IEnumerator)_003C_003E7__wrap1).MoveNext())1326 {1327 IEntity current = _003C_003E7__wrap1.Current;1328 current.MarkForDeletion();1329 val4 = parameters.UnitOfWork.PutAsync(current, ct).ConfigureAwait(false);1330 val = ((ConfiguredTaskAwaitable)(ref val4)).GetAwaiter();1331 if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)1332 {1333 num = (_003C_003E1__state = 2);1334 _003C_003Eu__3 = val;1335 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnSavedAsync_003Ed__8>(ref val, ref this);1336 return;1337 }1338 goto IL_0292;1339 }1340 }1341 finally1342 {1343 if (num < 0 && _003C_003E7__wrap1 != null)1344 {1345 ((System.IDisposable)_003C_003E7__wrap1).Dispose();1346 }1347 }1348 _003C_003E7__wrap1 = null;1349 _003C_003E8__1 = null;1350 goto IL_02d1;1351 case 3:1352 {1353 val = _003C_003Eu__3;1354 _003C_003Eu__3 = default(ConfiguredTaskAwaiter);1355 num = (_003C_003E1__state = -1);1356 break;1357 }1358 IL_02d1:1359 val4 = ((StateBasedEntityLogic)tSBAccountDefLogic).OnSavedAsync(entity, parameters, ct).ConfigureAwait(false);1360 val = ((ConfiguredTaskAwaitable)(ref val4)).GetAwaiter();1361 if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)1362 {1363 num = (_003C_003E1__state = 3);1364 _003C_003Eu__3 = val;1365 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnSavedAsync_003Ed__8>(ref val, ref this);1366 return;1367 }1368 break;1369 IL_01eb:1370 result = val2.GetResult();1371 _003C_003E7__wrap1 = ((System.Collections.Generic.IEnumerable<IEntity>)result).GetEnumerator();1372 goto case 2;1373 IL_0137:1374 result2 = val3.GetResult();1375 _003C_003E8__1.dbok = result2;1376 query = (from c in Query.From("TSBPersonUsesAccount")1377 where c.Column("ObjectKeyAccount") == _003C_003E8__1.dbok.ToXmlString()1378 select c).GetQuery();1379 val2 = parameters.Session.Source().GetCollectionAsync(query, EntityCollectionLoadType.Bulk, ct).ConfigureAwait(false)1380 .GetAwaiter();1381 if (!val2.IsCompleted)1382 {1383 num = (_003C_003E1__state = 1);1384 _003C_003Eu__2 = val2;1385 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntityCollection>, _003COnSavedAsync_003Ed__8>(ref val2, ref this);1386 return;1387 }1388 goto IL_01eb;1389 }1390 ((ConfiguredTaskAwaiter)(ref val)).GetResult();1391 }1392 catch (System.Exception exception)1393 {1394 _003C_003E1__state = -2;1395 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);1396 return;1397 }1398 _003C_003E1__state = -2;1399 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();1400 }14011402 [DebuggerHidden]1403 private void SetStateMachine(IAsyncStateMachine stateMachine)1404 {1405 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);1406 }1407 }14081409 [StructLayout((LayoutKind)3)]1410 [CompilerGenerated]1411 private struct _003COnSavingAsync_003Ed__7 : IAsyncStateMachine1412 {1413 public int _003C_003E1__state;14141415 public AsyncTaskMethodBuilder<Diff> _003C_003Et__builder;14161417 public TSBAccountDefLogic _003C_003E4__this;14181419 public IEntity entity;14201421 public LogicReadWriteParameters parameters;14221423 public CancellationToken cancellationToken;14241425 private Diff _003CrDiff_003E5__2;14261427 private ConfiguredTaskAwaiter<Diff> _003C_003Eu__1;14281429 private string _003CuidTsbAccountDef_003E5__3;14301431 private ConfiguredTaskAwaiter _003C_003Eu__2;14321433 private void MoveNext()1434 {1435 //IL_007b: Unknown result type (might be due to invalid IL or missing references)1436 //IL_0080: Unknown result type (might be due to invalid IL or missing references)1437 //IL_0088: Unknown result type (might be due to invalid IL or missing references)1438 //IL_0147: Unknown result type (might be due to invalid IL or missing references)1439 //IL_014c: Unknown result type (might be due to invalid IL or missing references)1440 //IL_0154: Unknown result type (might be due to invalid IL or missing references)1441 //IL_01e5: Unknown result type (might be due to invalid IL or missing references)1442 //IL_01ea: Unknown result type (might be due to invalid IL or missing references)1443 //IL_01f2: Unknown result type (might be due to invalid IL or missing references)1444 //IL_0266: Unknown result type (might be due to invalid IL or missing references)1445 //IL_026b: Unknown result type (might be due to invalid IL or missing references)1446 //IL_0273: Unknown result type (might be due to invalid IL or missing references)1447 //IL_0032: Unknown result type (might be due to invalid IL or missing references)1448 //IL_003d: Unknown result type (might be due to invalid IL or missing references)1449 //IL_0042: Unknown result type (might be due to invalid IL or missing references)1450 //IL_0046: Unknown result type (might be due to invalid IL or missing references)1451 //IL_004b: Unknown result type (might be due to invalid IL or missing references)1452 //IL_0060: Unknown result type (might be due to invalid IL or missing references)1453 //IL_0062: Unknown result type (might be due to invalid IL or missing references)1454 //IL_0220: Unknown result type (might be due to invalid IL or missing references)1455 //IL_022b: Unknown result type (might be due to invalid IL or missing references)1456 //IL_0230: Unknown result type (might be due to invalid IL or missing references)1457 //IL_0234: Unknown result type (might be due to invalid IL or missing references)1458 //IL_0239: Unknown result type (might be due to invalid IL or missing references)1459 //IL_019c: Unknown result type (might be due to invalid IL or missing references)1460 //IL_01a7: Unknown result type (might be due to invalid IL or missing references)1461 //IL_01ac: Unknown result type (might be due to invalid IL or missing references)1462 //IL_01b0: Unknown result type (might be due to invalid IL or missing references)1463 //IL_01b5: Unknown result type (might be due to invalid IL or missing references)1464 //IL_00fe: Unknown result type (might be due to invalid IL or missing references)1465 //IL_0109: Unknown result type (might be due to invalid IL or missing references)1466 //IL_010e: Unknown result type (might be due to invalid IL or missing references)1467 //IL_0112: Unknown result type (might be due to invalid IL or missing references)1468 //IL_0117: Unknown result type (might be due to invalid IL or missing references)1469 //IL_024e: Unknown result type (might be due to invalid IL or missing references)1470 //IL_0250: Unknown result type (might be due to invalid IL or missing references)1471 //IL_01ca: Unknown result type (might be due to invalid IL or missing references)1472 //IL_01cc: Unknown result type (might be due to invalid IL or missing references)1473 //IL_012c: Unknown result type (might be due to invalid IL or missing references)1474 //IL_012e: Unknown result type (might be due to invalid IL or missing references)1475 int num = _003C_003E1__state;1476 TSBAccountDefLogic tSBAccountDefLogic = _003C_003E4__this;1477 Diff result2;1478 try1479 {1480 ConfiguredTaskAwaiter<Diff> val2;1481 ConfiguredTaskAwaiter val;1482 Diff result;1483 ConfiguredTaskAwaitable val3;1484 switch (num)1485 {1486 default:1487 val2 = ((StateBasedEntityLogic)tSBAccountDefLogic).OnSavingAsync(entity, parameters, cancellationToken).ConfigureAwait(false).GetAwaiter();1488 if (!val2.IsCompleted)1489 {1490 num = (_003C_003E1__state = 0);1491 _003C_003Eu__1 = val2;1492 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<Diff>, _003COnSavingAsync_003Ed__7>(ref val2, ref this);1493 return;1494 }1495 goto IL_0097;1496 case 0:1497 val2 = _003C_003Eu__1;1498 _003C_003Eu__1 = default(ConfiguredTaskAwaiter<Diff>);1499 num = (_003C_003E1__state = -1);1500 goto IL_0097;1501 case 1:1502 val = _003C_003Eu__2;1503 _003C_003Eu__2 = default(ConfiguredTaskAwaiter);1504 num = (_003C_003E1__state = -1);1505 goto IL_0163;1506 case 2:1507 val = _003C_003Eu__2;1508 _003C_003Eu__2 = default(ConfiguredTaskAwaiter);1509 num = (_003C_003E1__state = -1);1510 goto IL_0201;1511 case 3:1512 {1513 val = _003C_003Eu__2;1514 _003C_003Eu__2 = default(ConfiguredTaskAwaiter);1515 num = (_003C_003E1__state = -1);1516 goto IL_0282;1517 }1518 IL_0289:1519 _003CuidTsbAccountDef_003E5__3 = null;1520 break;1521 IL_0097:1522 result = val2.GetResult();1523 _003CrDiff_003E5__2 = result;1524 if (parameters.Session.IsFullSync())1525 {1526 break;1527 }1528 _003CuidTsbAccountDef_003E5__3 = entity.GetValue<string>("UID_TSBAccountDef");1529 if (!string.IsNullOrEmpty(_003CuidTsbAccountDef_003E5__3))1530 {1531 val3 = CheckPersonHasTSBAccountDef(parameters.Session, entity, parameters.UnitOfWork, cancellationToken).ConfigureAwait(false);1532 val = ((ConfiguredTaskAwaitable)(ref val3)).GetAwaiter();1533 if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)1534 {1535 num = (_003C_003E1__state = 1);1536 _003C_003Eu__2 = val;1537 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnSavingAsync_003Ed__7>(ref val, ref this);1538 return;1539 }1540 goto IL_0163;1541 }1542 goto IL_0289;1543 IL_0282:1544 ((ConfiguredTaskAwaiter)(ref val)).GetResult();1545 goto IL_0289;1546 IL_0201:1547 ((ConfiguredTaskAwaiter)(ref val)).GetResult();1548 goto IL_0208;1549 IL_0208:1550 val3 = CheckUniqueAccount(parameters.Session, entity, _003CuidTsbAccountDef_003E5__3, cancellationToken).ConfigureAwait(false);1551 val = ((ConfiguredTaskAwaitable)(ref val3)).GetAwaiter();1552 if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)1553 {1554 num = (_003C_003E1__state = 3);1555 _003C_003Eu__2 = val;1556 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnSavingAsync_003Ed__7>(ref val, ref this);1557 return;1558 }1559 goto IL_0282;1560 IL_0163:1561 ((ConfiguredTaskAwaiter)(ref val)).GetResult();1562 if (entity.Columns.Contains("UID_TSBBehavior"))1563 {1564 val3 = CheckTSBBahavior(parameters.Session, entity, _003CuidTsbAccountDef_003E5__3, cancellationToken).ConfigureAwait(false);1565 val = ((ConfiguredTaskAwaitable)(ref val3)).GetAwaiter();1566 if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)1567 {1568 num = (_003C_003E1__state = 2);1569 _003C_003Eu__2 = val;1570 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnSavingAsync_003Ed__7>(ref val, ref this);1571 return;1572 }1573 goto IL_0201;1574 }1575 goto IL_0208;1576 }1577 result2 = _003CrDiff_003E5__2;1578 }1579 catch (System.Exception exception)1580 {1581 _003C_003E1__state = -2;1582 _003CrDiff_003E5__2 = null;1583 _003C_003Et__builder.SetException(exception);1584 return;1585 }1586 _003C_003E1__state = -2;1587 _003CrDiff_003E5__2 = null;1588 _003C_003Et__builder.SetResult(result2);1589 }15901591 [DebuggerHidden]1592 private void SetStateMachine(IAsyncStateMachine stateMachine)1593 {1594 _003C_003Et__builder.SetStateMachine(stateMachine);1595 }1596 }15971598 [StructLayout((LayoutKind)3)]1599 [CompilerGenerated]1600 private struct _003CRevokeAccountDef_003Ed__4 : IAsyncStateMachine1601 {1602 public int _003C_003E1__state;16031604 public AsyncTaskMethodBuilder<bool> _003C_003Et__builder;16051606 public IEntity entity;16071608 public ISession session;16091610 public CancellationToken ct;16111612 private _003C_003Ec__DisplayClass4_0 _003C_003E8__1;16131614 private ConfiguredTaskAwaiter<TryResult<IEntity>> _003C_003Eu__1;16151616 private ConfiguredValueTaskAwaiter<ApplyResult> _003C_003Eu__2;16171618 private void MoveNext()1619 {1620 //IL_00b2: Unknown result type (might be due to invalid IL or missing references)1621 //IL_00b7: Unknown result type (might be due to invalid IL or missing references)1622 //IL_00bf: Unknown result type (might be due to invalid IL or missing references)1623 //IL_015c: Unknown result type (might be due to invalid IL or missing references)1624 //IL_0161: Unknown result type (might be due to invalid IL or missing references)1625 //IL_0169: Unknown result type (might be due to invalid IL or missing references)1626 //IL_01dc: Unknown result type (might be due to invalid IL or missing references)1627 //IL_01e1: Unknown result type (might be due to invalid IL or missing references)1628 //IL_01e9: Unknown result type (might be due to invalid IL or missing references)1629 //IL_0069: Unknown result type (might be due to invalid IL or missing references)1630 //IL_0074: Unknown result type (might be due to invalid IL or missing references)1631 //IL_0079: Unknown result type (might be due to invalid IL or missing references)1632 //IL_007d: Unknown result type (might be due to invalid IL or missing references)1633 //IL_0082: Unknown result type (might be due to invalid IL or missing references)1634 //IL_0192: Unknown result type (might be due to invalid IL or missing references)1635 //IL_01a1: Unknown result type (might be due to invalid IL or missing references)1636 //IL_01a6: Unknown result type (might be due to invalid IL or missing references)1637 //IL_01aa: Unknown result type (might be due to invalid IL or missing references)1638 //IL_01af: Unknown result type (might be due to invalid IL or missing references)1639 //IL_0097: Unknown result type (might be due to invalid IL or missing references)1640 //IL_0099: Unknown result type (might be due to invalid IL or missing references)1641 //IL_010f: Unknown result type (might be due to invalid IL or missing references)1642 //IL_011e: Unknown result type (might be due to invalid IL or missing references)1643 //IL_0123: Unknown result type (might be due to invalid IL or missing references)1644 //IL_0127: Unknown result type (might be due to invalid IL or missing references)1645 //IL_012c: Unknown result type (might be due to invalid IL or missing references)1646 //IL_01c4: Unknown result type (might be due to invalid IL or missing references)1647 //IL_01c6: Unknown result type (might be due to invalid IL or missing references)1648 //IL_0141: Unknown result type (might be due to invalid IL or missing references)1649 //IL_0143: Unknown result type (might be due to invalid IL or missing references)1650 int num = _003C_003E1__state;1651 bool result2;1652 try1653 {1654 ConfiguredTaskAwaiter<TryResult<IEntity>> val2;1655 ConfiguredValueTaskAwaiter<ApplyResult> val;1656 TryResult<IEntity> result;1657 switch (num)1658 {1659 default:1660 {1661 _003C_003E8__1 = new _003C_003Ec__DisplayClass4_0();1662 _003C_003E8__1.entity = entity;1663 Query query = (from c in Query.From("PersonHasTSBAccountDef")1664 where c.Column("UID_TSBAccountDef") == _003C_003E8__1.entity.GetValue<string>("UID_TSBAccountDef") && c.Column("UID_Person") == _003C_003E8__1.entity.GetValue<string>("UID_Person")1665 select c).GetQuery();1666 val2 = session.Source().TryGetAsync(query, EntityLoadType.DelayedLogic, ct).ConfigureAwait(false)1667 .GetAwaiter();1668 if (!val2.IsCompleted)1669 {1670 num = (_003C_003E1__state = 0);1671 _003C_003Eu__1 = val2;1672 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<TryResult<IEntity>>, _003CRevokeAccountDef_003Ed__4>(ref val2, ref this);1673 return;1674 }1675 goto IL_00ce;1676 }1677 case 0:1678 val2 = _003C_003Eu__1;1679 _003C_003Eu__1 = default(ConfiguredTaskAwaiter<TryResult<IEntity>>);1680 num = (_003C_003E1__state = -1);1681 goto IL_00ce;1682 case 1:1683 val = _003C_003Eu__2;1684 _003C_003Eu__2 = default(ConfiguredValueTaskAwaiter<ApplyResult>);1685 num = (_003C_003E1__state = -1);1686 goto IL_0178;1687 case 2:1688 {1689 val = _003C_003Eu__2;1690 _003C_003Eu__2 = default(ConfiguredValueTaskAwaiter<ApplyResult>);1691 num = (_003C_003E1__state = -1);1692 break;1693 }1694 IL_0178:1695 val.GetResult();1696 val = _003C_003E8__1.entity.PutValueAsync("UID_TSBAccountDef", null, ct).ConfigureAwait(false).GetAwaiter();1697 if (!val.IsCompleted)1698 {1699 num = (_003C_003E1__state = 2);1700 _003C_003Eu__2 = val;1701 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<ApplyResult>, _003CRevokeAccountDef_003Ed__4>(ref val, ref this);1702 return;1703 }1704 break;1705 IL_00ce:1706 result = val2.GetResult();1707 if (result.Success && result.Result.GetValue<int>("XOrigin") != 1)1708 {1709 throw new ViException(2088505, ExceptionRelevance.EndUser);1710 }1711 val = _003C_003E8__1.entity.TryPutValueAsync("UID_TSBBehavior", null, ct).ConfigureAwait(false).GetAwaiter();1712 if (!val.IsCompleted)1713 {1714 num = (_003C_003E1__state = 1);1715 _003C_003Eu__2 = val;1716 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<ApplyResult>, _003CRevokeAccountDef_003Ed__4>(ref val, ref this);1717 return;1718 }1719 goto IL_0178;1720 }1721 val.GetResult();1722 result2 = true;1723 }1724 catch (System.Exception exception)1725 {1726 _003C_003E1__state = -2;1727 _003C_003E8__1 = null;1728 _003C_003Et__builder.SetException(exception);1729 return;1730 }1731 _003C_003E1__state = -2;1732 _003C_003E8__1 = null;1733 _003C_003Et__builder.SetResult(result2);1734 }17351736 [DebuggerHidden]1737 private void SetStateMachine(IAsyncStateMachine stateMachine)1738 {1739 _003C_003Et__builder.SetStateMachine(stateMachine);1740 }1741 }17421743 [StructLayout((LayoutKind)3)]1744 [CompilerGenerated]1745 private struct _003CRevokeAccountDef_OnSaving_003Ed__5 : IAsyncStateMachine1746 {1747 public int _003C_003E1__state;17481749 public AsyncTaskMethodBuilder _003C_003Et__builder;17501751 public IEntity entity;17521753 public LogicReadWriteParameters parameter;17541755 public CancellationToken ct;17561757 private ConfiguredTaskAwaiter<TryResult<IEntity>> _003C_003Eu__1;17581759 private IEntity _003CePhA_003E5__2;17601761 private ConfiguredValueTaskAwaiter<ApplyResult> _003C_003Eu__2;17621763 private ConfiguredTaskAwaiter _003C_003Eu__3;17641765 private void MoveNext()1766 {1767 //IL_00a8: Unknown result type (might be due to invalid IL or missing references)1768 //IL_00ad: Unknown result type (might be due to invalid IL or missing references)1769 //IL_00b5: Unknown result type (might be due to invalid IL or missing references)1770 //IL_0154: Unknown result type (might be due to invalid IL or missing references)1771 //IL_0159: Unknown result type (might be due to invalid IL or missing references)1772 //IL_0161: Unknown result type (might be due to invalid IL or missing references)1773 //IL_01d0: Unknown result type (might be due to invalid IL or missing references)1774 //IL_01d5: Unknown result type (might be due to invalid IL or missing references)1775 //IL_01dd: Unknown result type (might be due to invalid IL or missing references)1776 //IL_005f: Unknown result type (might be due to invalid IL or missing references)1777 //IL_006a: Unknown result type (might be due to invalid IL or missing references)1778 //IL_006f: Unknown result type (might be due to invalid IL or missing references)1779 //IL_0073: Unknown result type (might be due to invalid IL or missing references)1780 //IL_0078: Unknown result type (might be due to invalid IL or missing references)1781 //IL_018a: Unknown result type (might be due to invalid IL or missing references)1782 //IL_0195: Unknown result type (might be due to invalid IL or missing references)1783 //IL_019a: Unknown result type (might be due to invalid IL or missing references)1784 //IL_019e: Unknown result type (might be due to invalid IL or missing references)1785 //IL_01a3: Unknown result type (might be due to invalid IL or missing references)1786 //IL_008d: Unknown result type (might be due to invalid IL or missing references)1787 //IL_008f: Unknown result type (might be due to invalid IL or missing references)1788 //IL_0107: Unknown result type (might be due to invalid IL or missing references)1789 //IL_0116: Unknown result type (might be due to invalid IL or missing references)1790 //IL_011b: Unknown result type (might be due to invalid IL or missing references)1791 //IL_011f: Unknown result type (might be due to invalid IL or missing references)1792 //IL_0124: Unknown result type (might be due to invalid IL or missing references)1793 //IL_01b8: Unknown result type (might be due to invalid IL or missing references)1794 //IL_01ba: Unknown result type (might be due to invalid IL or missing references)1795 //IL_0139: Unknown result type (might be due to invalid IL or missing references)1796 //IL_013b: Unknown result type (might be due to invalid IL or missing references)1797 int num = _003C_003E1__state;1798 try1799 {1800 ConfiguredTaskAwaiter<TryResult<IEntity>> val3;1801 ConfiguredValueTaskAwaiter<ApplyResult> val2;1802 ConfiguredTaskAwaiter val;1803 ConfiguredTaskAwaitable val4;1804 TryResult<IEntity> result;1805 switch (num)1806 {1807 default:1808 {1809 _003C_003Ec__DisplayClass5_0 CS_0024_003C_003E8__locals2 = new _003C_003Ec__DisplayClass5_01810 {1811 entity = entity1812 };1813 Query query = (from c in Query.From("PersonHasTSBAccountDef")1814 where c.Column("UID_TSBAccountDef") == CS_0024_003C_003E8__locals2.entity.GetValue<string>("UID_TSBAccountDef[o]") && c.Column("UID_Person") == CS_0024_003C_003E8__locals2.entity.GetValue<string>("UID_Person[o]")1815 select c).GetQuery();1816 val3 = parameter.Session.Source().TryGetAsync(query, EntityLoadType.DelayedLogic, ct).ConfigureAwait(false)1817 .GetAwaiter();1818 if (!val3.IsCompleted)1819 {1820 num = (_003C_003E1__state = 0);1821 _003C_003Eu__1 = val3;1822 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<TryResult<IEntity>>, _003CRevokeAccountDef_OnSaving_003Ed__5>(ref val3, ref this);1823 return;1824 }1825 goto IL_00c4;1826 }1827 case 0:1828 val3 = _003C_003Eu__1;1829 _003C_003Eu__1 = default(ConfiguredTaskAwaiter<TryResult<IEntity>>);1830 num = (_003C_003E1__state = -1);1831 goto IL_00c4;1832 case 1:1833 val2 = _003C_003Eu__2;1834 _003C_003Eu__2 = default(ConfiguredValueTaskAwaiter<ApplyResult>);1835 num = (_003C_003E1__state = -1);1836 goto IL_0170;1837 case 2:1838 {1839 val = _003C_003Eu__3;1840 _003C_003Eu__3 = default(ConfiguredTaskAwaiter);1841 num = (_003C_003E1__state = -1);1842 break;1843 }1844 IL_0170:1845 val2.GetResult();1846 val4 = parameter.UnitOfWork.PutAsync(_003CePhA_003E5__2, ct).ConfigureAwait(false);1847 val = ((ConfiguredTaskAwaitable)(ref val4)).GetAwaiter();1848 if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)1849 {1850 num = (_003C_003E1__state = 2);1851 _003C_003Eu__3 = val;1852 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003CRevokeAccountDef_OnSaving_003Ed__5>(ref val, ref this);1853 return;1854 }1855 break;1856 IL_00c4:1857 result = val3.GetResult();1858 if (result.Success)1859 {1860 _003CePhA_003E5__2 = result.Result;1861 val2 = _003CePhA_003E5__2.PutValueAsync("XOrigin", _003CePhA_003E5__2.GetValue<int>("XOrigin") & -2, ct).ConfigureAwait(false).GetAwaiter();1862 if (!val2.IsCompleted)1863 {1864 num = (_003C_003E1__state = 1);1865 _003C_003Eu__2 = val2;1866 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<ApplyResult>, _003CRevokeAccountDef_OnSaving_003Ed__5>(ref val2, ref this);1867 return;1868 }1869 goto IL_0170;1870 }1871 goto end_IL_0007;1872 }1873 ((ConfiguredTaskAwaiter)(ref val)).GetResult();1874 _003CePhA_003E5__2 = null;1875 end_IL_0007:;1876 }1877 catch (System.Exception exception)1878 {1879 _003C_003E1__state = -2;1880 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);1881 return;1882 }1883 _003C_003E1__state = -2;1884 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();1885 }18861887 [DebuggerHidden]1888 private void SetStateMachine(IAsyncStateMachine stateMachine)1889 {1890 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);1891 }1892 }18931894 public TSBAccountDefLogic(EntityLogicConstructionParameters cp)1895 {1896 using (base.Section.Except("SPECIAL(IsFullSync)"))1897 {1898 CanEdit("UID_TSBAccountDef").From("UID_Person", "UID_TSBAccountDef[o]").As<string, string>((Func<string, string, bool>)((string uidPerson, string uidTSBAccountDef) => !string.IsNullOrEmpty(uidPerson) && string.IsNullOrEmpty(uidTSBAccountDef)));1899 CanEdit("UID_Person").From("UID_Person", "UID_TSBAccountDef", "[IsLoaded]").As<string, string, bool>((Func<string, string, bool, bool>)((string uidPerson, string uidTSBAccountDef, bool isLoaded) => string.IsNullOrEmpty(uidPerson) || string.IsNullOrEmpty(uidTSBAccountDef) || !isLoaded));1900 if (cp.Table.Columns.Contains("UID_TSBBehavior"))1901 {1902 CanEdit("UID_TSBBehavior").From("UID_TSBAccountDef", "UID_Person").As<string, string>((Func<string, string, bool>)((string uidTSBAccountDef, string uidPerson) => !string.IsNullOrEmpty(uidTSBAccountDef) && !string.IsNullOrEmpty(uidPerson))).MandatoryWhenEnabled()1903 .ClearValueOnFalse();1904 }1905 }1906 RegisterExtendedMethod("AssignAccountDef").As<string, string, string, bool>((Func<ISession, IEntity, string, string, string, CancellationToken, System.Threading.Tasks.Task<bool>>)AssignAccountDef).OnSaving(AssignAccountDef_OnSaving).Visible()1907 .From("UID_TSBAccountDef")1908 .As<string>((Func<string, bool>)((string uidTsbAccountDef) => string.IsNullOrEmpty(uidTsbAccountDef)));1909 RegisterExtendedMethod("RevokeAccountDef").As<bool>((Func<ISession, IEntity, CancellationToken, System.Threading.Tasks.Task<bool>>)RevokeAccountDef).OnSaving(RevokeAccountDef_OnSaving).Visible()1910 .From("UID_TSBAccountDef")1911 .As<string>((Func<string, bool>)((string uidTsbAccountDef) => !string.IsNullOrEmpty(uidTsbAccountDef)));1912 }19131914 [AsyncStateMachine(typeof(_003CExistsPersonHasTSBAccountDef_003Ed__1))]1915 private static async System.Threading.Tasks.Task<bool> ExistsPersonHasTSBAccountDef(ISession session, IEntity entity, CancellationToken ct)1916 {1917 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1918 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1919 //IL_001e: Unknown result type (might be due to invalid IL or missing references)1920 //IL_001f: Unknown result type (might be due to invalid IL or missing references)1921 string uidTSBAccountDef = entity.GetValue<string>("UID_TSBAccountDef");1922 string uidPerson = entity.GetValue<string>("UID_Person");1923 Query query = (from c in Query.From("PersonHasTSBAccountDef")1924 where c.Column("UID_TSBAccountDef") == uidTSBAccountDef && c.Column("UID_Person") == uidPerson && c.Column("XIsInEffect") == true1925 select c).GetQuery();1926 return await session.Source().ExistsAsync(query, ct).ConfigureAwait(false);1927 }19281929 [AsyncStateMachine(typeof(_003CAssignAccountDef_003Ed__2))]1930 private async System.Threading.Tasks.Task<bool> AssignAccountDef(ISession session, IEntity entity, string uidPerson, string uidTSBAccountDef, string uidTSBBehavior, CancellationToken ct)1931 {1932 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1933 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1934 //IL_0038: Unknown result type (might be due to invalid IL or missing references)1935 //IL_003a: Unknown result type (might be due to invalid IL or missing references)1936 if (string.IsNullOrWhiteSpace(uidPerson))1937 {1938 throw new ArgumentNullException("uidPerson");1939 }1940 if (string.IsNullOrWhiteSpace(uidTSBAccountDef))1941 {1942 throw new ArgumentNullException("uidTSBAccountDef");1943 }1944 using (StartInternalProcess())1945 {1946 await entity.PutValueAsync("UID_Person", uidPerson, ct).ConfigureAwait(false);1947 await entity.PutValueAsync("UID_TSBAccountDef", uidTSBAccountDef, ct).ConfigureAwait(false);1948 if (!string.IsNullOrEmpty(uidTSBBehavior))1949 {1950 await entity.TryPutValueAsync("UID_TSBBehavior", uidTSBBehavior, ct).ConfigureAwait(false);1951 }1952 }1953 return true;1954 }19551956 [AsyncStateMachine(typeof(_003CAssignAccountDef_OnSaving_003Ed__3))]1957 private System.Threading.Tasks.Task AssignAccountDef_OnSaving(IEntity entity, LogicReadWriteParameters parameter, bool bResult, CancellationToken ct)1958 {1959 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1960 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1961 //IL_001e: Unknown result type (might be due to invalid IL or missing references)1962 //IL_0020: Unknown result type (might be due to invalid IL or missing references)1963 _003CAssignAccountDef_OnSaving_003Ed__3 _003CAssignAccountDef_OnSaving_003Ed__ = default(_003CAssignAccountDef_OnSaving_003Ed__3);1964 _003CAssignAccountDef_OnSaving_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();1965 _003CAssignAccountDef_OnSaving_003Ed__.entity = entity;1966 _003CAssignAccountDef_OnSaving_003Ed__.parameter = parameter;1967 _003CAssignAccountDef_OnSaving_003Ed__.ct = ct;1968 _003CAssignAccountDef_OnSaving_003Ed__._003C_003E1__state = -1;1969 ((AsyncTaskMethodBuilder)(ref _003CAssignAccountDef_OnSaving_003Ed__._003C_003Et__builder)).Start<_003CAssignAccountDef_OnSaving_003Ed__3>(ref _003CAssignAccountDef_OnSaving_003Ed__);1970 return ((AsyncTaskMethodBuilder)(ref _003CAssignAccountDef_OnSaving_003Ed__._003C_003Et__builder)).Task;1971 }19721973 [AsyncStateMachine(typeof(_003CRevokeAccountDef_003Ed__4))]1974 private async System.Threading.Tasks.Task<bool> RevokeAccountDef(ISession session, IEntity entity, CancellationToken ct)1975 {1976 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1977 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1978 //IL_001e: Unknown result type (might be due to invalid IL or missing references)1979 //IL_001f: Unknown result type (might be due to invalid IL or missing references)1980 Query query = (from c in Query.From("PersonHasTSBAccountDef")1981 where c.Column("UID_TSBAccountDef") == entity.GetValue<string>("UID_TSBAccountDef") && c.Column("UID_Person") == entity.GetValue<string>("UID_Person")1982 select c).GetQuery();1983 TryResult<IEntity> tryResult = await session.Source().TryGetAsync(query, EntityLoadType.DelayedLogic, ct).ConfigureAwait(false);1984 if (tryResult.Success && tryResult.Result.GetValue<int>("XOrigin") != 1)1985 {1986 throw new ViException(2088505, ExceptionRelevance.EndUser);1987 }1988 await entity.TryPutValueAsync("UID_TSBBehavior", null, ct).ConfigureAwait(false);1989 await entity.PutValueAsync("UID_TSBAccountDef", null, ct).ConfigureAwait(false);1990 return true;1991 }19921993 [AsyncStateMachine(typeof(_003CRevokeAccountDef_OnSaving_003Ed__5))]1994 private System.Threading.Tasks.Task RevokeAccountDef_OnSaving(IEntity entity, LogicReadWriteParameters parameter, bool bResult, CancellationToken ct)1995 {1996 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1997 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1998 //IL_001e: Unknown result type (might be due to invalid IL or missing references)1999 //IL_0020: Unknown result type (might be due to invalid IL or missing references)2000 _003CRevokeAccountDef_OnSaving_003Ed__5 _003CRevokeAccountDef_OnSaving_003Ed__ = default(_003CRevokeAccountDef_OnSaving_003Ed__5);2001 _003CRevokeAccountDef_OnSaving_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();2002 _003CRevokeAccountDef_OnSaving_003Ed__.entity = entity;2003 _003CRevokeAccountDef_OnSaving_003Ed__.parameter = parameter;2004 _003CRevokeAccountDef_OnSaving_003Ed__.ct = ct;2005 _003CRevokeAccountDef_OnSaving_003Ed__._003C_003E1__state = -1;2006 ((AsyncTaskMethodBuilder)(ref _003CRevokeAccountDef_OnSaving_003Ed__._003C_003Et__builder)).Start<_003CRevokeAccountDef_OnSaving_003Ed__5>(ref _003CRevokeAccountDef_OnSaving_003Ed__);2007 return ((AsyncTaskMethodBuilder)(ref _003CRevokeAccountDef_OnSaving_003Ed__._003C_003Et__builder)).Task;2008 }20092010 [AsyncStateMachine(typeof(_003CGetLocalDependenciesAsync_003Ed__6))]2011 public override async System.Threading.Tasks.Task<Bow<string>[]> GetLocalDependenciesAsync(IMetaTable table, CancellationToken cancellationToken)2012 {2013 //IL_0002: Unknown result type (might be due to invalid IL or missing references)2014 //IL_0007: Unknown result type (might be due to invalid IL or missing references)2015 //IL_001e: Unknown result type (might be due to invalid IL or missing references)2016 //IL_001f: Unknown result type (might be due to invalid IL or missing references)2017 return Enumerable.Where<Bow<string>>((System.Collections.Generic.IEnumerable<Bow<string>>)(await base.GetLocalDependenciesAsync(table, cancellationToken).ConfigureAwait(false)), (Func<Bow<string>, bool>)((Bow<string> b) => b.To != "UID_Person" || b.From != "UID_TSBAccountDef")).ToArraySmart();2018 }20192020 [AsyncStateMachine(typeof(_003COnSavingAsync_003Ed__7))]2021 public override async System.Threading.Tasks.Task<Diff> OnSavingAsync(IEntity entity, LogicReadWriteParameters parameters, CancellationToken cancellationToken)2022 {2023 //IL_0002: Unknown result type (might be due to invalid IL or missing references)2024 //IL_0007: Unknown result type (might be due to invalid IL or missing references)2025 //IL_0026: Unknown result type (might be due to invalid IL or missing references)2026 //IL_0027: Unknown result type (might be due to invalid IL or missing references)2027 Diff rDiff = await base.OnSavingAsync(entity, parameters, cancellationToken).ConfigureAwait(false);2028 if (!parameters.Session.IsFullSync())2029 {2030 string uidTsbAccountDef = entity.GetValue<string>("UID_TSBAccountDef");2031 if (!string.IsNullOrEmpty(uidTsbAccountDef))2032 {2033 await CheckPersonHasTSBAccountDef(parameters.Session, entity, parameters.UnitOfWork, cancellationToken).ConfigureAwait(false);2034 if (entity.Columns.Contains("UID_TSBBehavior"))2035 {2036 await CheckTSBBahavior(parameters.Session, entity, uidTsbAccountDef, cancellationToken).ConfigureAwait(false);2037 }2038 await CheckUniqueAccount(parameters.Session, entity, uidTsbAccountDef, cancellationToken).ConfigureAwait(false);2039 }2040 }2041 return rDiff;2042 }20432044 [AsyncStateMachine(typeof(_003COnSavedAsync_003Ed__8))]2045 public override System.Threading.Tasks.Task OnSavedAsync(IEntity entity, LogicReadWriteParameters parameters, CancellationToken ct)2046 {2047 //IL_0002: Unknown result type (might be due to invalid IL or missing references)2048 //IL_0007: Unknown result type (might be due to invalid IL or missing references)2049 //IL_0026: Unknown result type (might be due to invalid IL or missing references)2050 //IL_0027: Unknown result type (might be due to invalid IL or missing references)2051 _003COnSavedAsync_003Ed__8 _003COnSavedAsync_003Ed__ = default(_003COnSavedAsync_003Ed__8);2052 _003COnSavedAsync_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();2053 _003COnSavedAsync_003Ed__._003C_003E4__this = this;2054 _003COnSavedAsync_003Ed__.entity = entity;2055 _003COnSavedAsync_003Ed__.parameters = parameters;2056 _003COnSavedAsync_003Ed__.ct = ct;2057 _003COnSavedAsync_003Ed__._003C_003E1__state = -1;2058 ((AsyncTaskMethodBuilder)(ref _003COnSavedAsync_003Ed__._003C_003Et__builder)).Start<_003COnSavedAsync_003Ed__8>(ref _003COnSavedAsync_003Ed__);2059 return ((AsyncTaskMethodBuilder)(ref _003COnSavedAsync_003Ed__._003C_003Et__builder)).Task;2060 }20612062 [AsyncStateMachine(typeof(_003CCheckPersonHasTSBAccountDef_003Ed__9))]2063 private static System.Threading.Tasks.Task CheckPersonHasTSBAccountDef(ISession session, IEntity entity, IUnitOfWork uow, CancellationToken ct)2064 {2065 //IL_0002: Unknown result type (might be due to invalid IL or missing references)2066 //IL_0007: Unknown result type (might be due to invalid IL or missing references)2067 //IL_0026: Unknown result type (might be due to invalid IL or missing references)2068 //IL_0027: Unknown result type (might be due to invalid IL or missing references)2069 _003CCheckPersonHasTSBAccountDef_003Ed__9 _003CCheckPersonHasTSBAccountDef_003Ed__ = default(_003CCheckPersonHasTSBAccountDef_003Ed__9);2070 _003CCheckPersonHasTSBAccountDef_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();2071 _003CCheckPersonHasTSBAccountDef_003Ed__.session = session;2072 _003CCheckPersonHasTSBAccountDef_003Ed__.entity = entity;2073 _003CCheckPersonHasTSBAccountDef_003Ed__.uow = uow;2074 _003CCheckPersonHasTSBAccountDef_003Ed__.ct = ct;2075 _003CCheckPersonHasTSBAccountDef_003Ed__._003C_003E1__state = -1;2076 ((AsyncTaskMethodBuilder)(ref _003CCheckPersonHasTSBAccountDef_003Ed__._003C_003Et__builder)).Start<_003CCheckPersonHasTSBAccountDef_003Ed__9>(ref _003CCheckPersonHasTSBAccountDef_003Ed__);2077 return ((AsyncTaskMethodBuilder)(ref _003CCheckPersonHasTSBAccountDef_003Ed__._003C_003Et__builder)).Task;2078 }20792080 [AsyncStateMachine(typeof(_003CCheckTSBBahavior_003Ed__10))]2081 private static System.Threading.Tasks.Task CheckTSBBahavior(ISession session, IEntity entity, string uidTsbAccountDef, CancellationToken ct)2082 {2083 //IL_0002: Unknown result type (might be due to invalid IL or missing references)2084 //IL_0007: Unknown result type (might be due to invalid IL or missing references)2085 //IL_0026: Unknown result type (might be due to invalid IL or missing references)2086 //IL_0027: Unknown result type (might be due to invalid IL or missing references)2087 _003CCheckTSBBahavior_003Ed__10 _003CCheckTSBBahavior_003Ed__ = default(_003CCheckTSBBahavior_003Ed__10);2088 _003CCheckTSBBahavior_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();2089 _003CCheckTSBBahavior_003Ed__.session = session;2090 _003CCheckTSBBahavior_003Ed__.entity = entity;2091 _003CCheckTSBBahavior_003Ed__.uidTsbAccountDef = uidTsbAccountDef;2092 _003CCheckTSBBahavior_003Ed__.ct = ct;2093 _003CCheckTSBBahavior_003Ed__._003C_003E1__state = -1;2094 ((AsyncTaskMethodBuilder)(ref _003CCheckTSBBahavior_003Ed__._003C_003Et__builder)).Start<_003CCheckTSBBahavior_003Ed__10>(ref _003CCheckTSBBahavior_003Ed__);2095 return ((AsyncTaskMethodBuilder)(ref _003CCheckTSBBahavior_003Ed__._003C_003Et__builder)).Task;2096 }20972098 [AsyncStateMachine(typeof(_003CCheckUniqueAccount_003Ed__11))]2099 private static System.Threading.Tasks.Task CheckUniqueAccount(ISession session, IEntity entity, string uidTsbAccountDef, CancellationToken ct)2100 {2101 //IL_0002: Unknown result type (might be due to invalid IL or missing references)2102 //IL_0007: Unknown result type (might be due to invalid IL or missing references)2103 //IL_0026: Unknown result type (might be due to invalid IL or missing references)2104 //IL_0027: Unknown result type (might be due to invalid IL or missing references)2105 _003CCheckUniqueAccount_003Ed__11 _003CCheckUniqueAccount_003Ed__ = default(_003CCheckUniqueAccount_003Ed__11);2106 _003CCheckUniqueAccount_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();2107 _003CCheckUniqueAccount_003Ed__.session = session;2108 _003CCheckUniqueAccount_003Ed__.entity = entity;2109 _003CCheckUniqueAccount_003Ed__.uidTsbAccountDef = uidTsbAccountDef;2110 _003CCheckUniqueAccount_003Ed__.ct = ct;2111 _003CCheckUniqueAccount_003Ed__._003C_003E1__state = -1;2112 ((AsyncTaskMethodBuilder)(ref _003CCheckUniqueAccount_003Ed__._003C_003Et__builder)).Start<_003CCheckUniqueAccount_003Ed__11>(ref _003CCheckUniqueAccount_003Ed__);2113 return ((AsyncTaskMethodBuilder)(ref _003CCheckUniqueAccount_003Ed__._003C_003Et__builder)).Task;2114 }2115}2116