QER.Customizer/QER.Customizer/DPRShell.cs
Decompiler Source FileQER.Customizer.DPRShellDecompiled 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: CreateShellOwnerRole at line 974
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 writes entity values references DB/Dialog objects
Summary: classes DPRShell, _003C_003Ec__DisplayClass3_0, _003C_003Ec__DisplayClass5_0; methods _003C_CreateShellOwnerRole_OnSaving_003Eb__0, _003C_CheckAERoleShellOwner_003Eb__0, MoveNext, SetStateMachine, CreateShellOwnerRole, _CreateShellOwnerRole_OnSaving; references AERole, DPRShell; markers reads entity values, writes entity values, references DB/Dialog objects
Classes
DPRShell _003C_003Ec__DisplayClass3_0 _003C_003Ec__DisplayClass5_0Methods
OIM key/entity markers
UID_ParentAERole UID_AERole UID_AERoleShellOwner UID_DPRShellAPI/entity calls
GetValueAsync TryResult PutValue GetValue MetaData IsToDelete From Source PutValue SqlFormatterRegistrations / handlers
None extracted.
Complete Source
1using System;2using System.Diagnostics;3using System.Runtime.CompilerServices;4using System.Runtime.InteropServices;5using System.Threading;6using System.Threading.Tasks;7using VI.Base;8using VI.DB;9using VI.DB.Entities;10using VI.DB.Sync;1112namespace QER.Customizer;1314public class DPRShell : StateBasedEntityLogic15{16 [CompilerGenerated]17 private sealed class _003C_003Ec__DisplayClass3_018 {19 public string sDisplay;2021 internal ExpressionClause _003C_CreateShellOwnerRole_OnSaving_003Eb__0(IExpressionContext c)22 {23 return c.Column("UID_ParentAERole") == UidAERoleParent && c.Column("Ident_AERole") == sDisplay;24 }25 }2627 [CompilerGenerated]28 private sealed class _003C_003Ec__DisplayClass5_029 {30 public string uidAERoleShellOwner;3132 internal ExpressionClause _003C_CheckAERoleShellOwner_003Eb__0(IExpressionContext c)33 {34 return c.Column("UID_AERole") == uidAERoleShellOwner;35 }36 }3738 [StructLayout((LayoutKind)3)]39 [CompilerGenerated]40 private struct _003CCreateShellOwnerRole_003Ed__2 : IAsyncStateMachine41 {42 public int _003C_003E1__state;4344 public AsyncTaskMethodBuilder<object> _003C_003Et__builder;4546 public IEntity entity;4748 public CancellationToken ct;4950 public ISession session;5152 public DPRShell _003C_003E4__this;5354 private ConfiguredValueTaskAwaiter<string> _003C_003Eu__1;5556 private void MoveNext()57 {58 //IL_0072: Unknown result type (might be due to invalid IL or missing references)59 //IL_0077: Unknown result type (might be due to invalid IL or missing references)60 //IL_007e: Unknown result type (might be due to invalid IL or missing references)61 //IL_0027: Unknown result type (might be due to invalid IL or missing references)62 //IL_0036: Unknown result type (might be due to invalid IL or missing references)63 //IL_003b: Unknown result type (might be due to invalid IL or missing references)64 //IL_003f: Unknown result type (might be due to invalid IL or missing references)65 //IL_0044: Unknown result type (might be due to invalid IL or missing references)66 //IL_0058: Unknown result type (might be due to invalid IL or missing references)67 //IL_0059: Unknown result type (might be due to invalid IL or missing references)68 int num = _003C_003E1__state;69 DPRShell dPRShell = _003C_003E4__this;70 object result;71 try72 {73 ConfiguredValueTaskAwaiter<string> val;74 if (num != 0)75 {76 val = entity.Columns["UID_AERoleShellOwner"].GetValueAsync<string>(ct).ConfigureAwait(false).GetAwaiter();77 if (!val.IsCompleted)78 {79 num = (_003C_003E1__state = 0);80 _003C_003Eu__1 = val;81 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<string>, _003CCreateShellOwnerRole_003Ed__2>(ref val, ref this);82 return;83 }84 }85 else86 {87 val = _003C_003Eu__1;88 _003C_003Eu__1 = default(ConfiguredValueTaskAwaiter<string>);89 num = (_003C_003E1__state = -1);90 }91 if (!string.IsNullOrEmpty(val.GetResult()))92 {93 string translated = session.MetaData().GetTable(entity.Tablename).Columns["UID_AERoleShellOwner"].Display.Translated;94 throw new ViException(2224416, ExceptionRelevance.EndUser, translated);95 }96 result = dPRShell;97 }98 catch (System.Exception exception)99 {100 _003C_003E1__state = -2;101 _003C_003Et__builder.SetException(exception);102 return;103 }104 _003C_003E1__state = -2;105 _003C_003Et__builder.SetResult(result);106 }107108 [DebuggerHidden]109 private void SetStateMachine(IAsyncStateMachine stateMachine)110 {111 _003C_003Et__builder.SetStateMachine(stateMachine);112 }113 }114115 [StructLayout((LayoutKind)3)]116 [CompilerGenerated]117 private struct _003COnSavingAsync_003Ed__4 : IAsyncStateMachine118 {119 public int _003C_003E1__state;120121 public AsyncTaskMethodBuilder<Diff> _003C_003Et__builder;122123 public IEntity entity;124125 public CancellationToken cancellationToken;126127 public DPRShell _003C_003E4__this;128129 public LogicReadWriteParameters parameters;130131 private ConfiguredValueTaskAwaiter<string> _003C_003Eu__1;132133 private ConfiguredTaskAwaiter _003C_003Eu__2;134135 private ConfiguredTaskAwaiter<Diff> _003C_003Eu__3;136137 private void MoveNext()138 {139 //IL_0099: Unknown result type (might be due to invalid IL or missing references)140 //IL_009e: Unknown result type (might be due to invalid IL or missing references)141 //IL_00a5: Unknown result type (might be due to invalid IL or missing references)142 //IL_011d: Unknown result type (might be due to invalid IL or missing references)143 //IL_0122: Unknown result type (might be due to invalid IL or missing references)144 //IL_012a: Unknown result type (might be due to invalid IL or missing references)145 //IL_01b6: Unknown result type (might be due to invalid IL or missing references)146 //IL_01bb: Unknown result type (might be due to invalid IL or missing references)147 //IL_01c2: Unknown result type (might be due to invalid IL or missing references)148 //IL_0235: Unknown result type (might be due to invalid IL or missing references)149 //IL_023a: Unknown result type (might be due to invalid IL or missing references)150 //IL_0242: Unknown result type (might be due to invalid IL or missing references)151 //IL_02ac: Unknown result type (might be due to invalid IL or missing references)152 //IL_02b1: Unknown result type (might be due to invalid IL or missing references)153 //IL_02b9: Unknown result type (might be due to invalid IL or missing references)154 //IL_004e: Unknown result type (might be due to invalid IL or missing references)155 //IL_005d: Unknown result type (might be due to invalid IL or missing references)156 //IL_0062: Unknown result type (might be due to invalid IL or missing references)157 //IL_0066: Unknown result type (might be due to invalid IL or missing references)158 //IL_006b: Unknown result type (might be due to invalid IL or missing references)159 //IL_0266: Unknown result type (might be due to invalid IL or missing references)160 //IL_0271: Unknown result type (might be due to invalid IL or missing references)161 //IL_0276: Unknown result type (might be due to invalid IL or missing references)162 //IL_027a: Unknown result type (might be due to invalid IL or missing references)163 //IL_027f: Unknown result type (might be due to invalid IL or missing references)164 //IL_00d4: Unknown result type (might be due to invalid IL or missing references)165 //IL_00df: Unknown result type (might be due to invalid IL or missing references)166 //IL_00e4: Unknown result type (might be due to invalid IL or missing references)167 //IL_00e8: Unknown result type (might be due to invalid IL or missing references)168 //IL_00ed: Unknown result type (might be due to invalid IL or missing references)169 //IL_01ec: Unknown result type (might be due to invalid IL or missing references)170 //IL_01f7: Unknown result type (might be due to invalid IL or missing references)171 //IL_01fc: Unknown result type (might be due to invalid IL or missing references)172 //IL_0200: Unknown result type (might be due to invalid IL or missing references)173 //IL_0205: Unknown result type (might be due to invalid IL or missing references)174 //IL_016b: Unknown result type (might be due to invalid IL or missing references)175 //IL_017a: Unknown result type (might be due to invalid IL or missing references)176 //IL_017f: Unknown result type (might be due to invalid IL or missing references)177 //IL_0183: Unknown result type (might be due to invalid IL or missing references)178 //IL_0188: Unknown result type (might be due to invalid IL or missing references)179 //IL_007f: Unknown result type (might be due to invalid IL or missing references)180 //IL_0080: Unknown result type (might be due to invalid IL or missing references)181 //IL_0294: Unknown result type (might be due to invalid IL or missing references)182 //IL_0296: Unknown result type (might be due to invalid IL or missing references)183 //IL_0102: Unknown result type (might be due to invalid IL or missing references)184 //IL_0104: Unknown result type (might be due to invalid IL or missing references)185 //IL_021a: Unknown result type (might be due to invalid IL or missing references)186 //IL_021c: Unknown result type (might be due to invalid IL or missing references)187 //IL_019c: Unknown result type (might be due to invalid IL or missing references)188 //IL_019d: Unknown result type (might be due to invalid IL or missing references)189 int num = _003C_003E1__state;190 DPRShell dPRShell = _003C_003E4__this;191 Diff result;192 try193 {194 ConfiguredValueTaskAwaiter<string> val3;195 ConfiguredTaskAwaiter val2;196 ConfiguredTaskAwaiter<Diff> val;197 ConfiguredTaskAwaitable val4;198 switch (num)199 {200 default:201 if (!entity.IsLoaded)202 {203 val3 = entity.Columns["UID_AERoleShellOwner"].GetValueAsync<string>(cancellationToken).ConfigureAwait(false).GetAwaiter();204 if (!val3.IsCompleted)205 {206 num = (_003C_003E1__state = 0);207 _003C_003Eu__1 = val3;208 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<string>, _003COnSavingAsync_003Ed__4>(ref val3, ref this);209 return;210 }211 goto IL_00b4;212 }213 if (entity.IsToDelete())214 {215 val3 = entity.Columns["UID_AERoleShellOwner"].GetValueAsync<string>(cancellationToken).ConfigureAwait(false).GetAwaiter();216 if (!val3.IsCompleted)217 {218 num = (_003C_003E1__state = 2);219 _003C_003Eu__1 = val3;220 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<string>, _003COnSavingAsync_003Ed__4>(ref val3, ref this);221 return;222 }223 goto IL_01d1;224 }225 goto IL_0258;226 case 0:227 val3 = _003C_003Eu__1;228 _003C_003Eu__1 = default(ConfiguredValueTaskAwaiter<string>);229 num = (_003C_003E1__state = -1);230 goto IL_00b4;231 case 1:232 val2 = _003C_003Eu__2;233 _003C_003Eu__2 = default(ConfiguredTaskAwaiter);234 num = (_003C_003E1__state = -1);235 goto IL_0139;236 case 2:237 val3 = _003C_003Eu__1;238 _003C_003Eu__1 = default(ConfiguredValueTaskAwaiter<string>);239 num = (_003C_003E1__state = -1);240 goto IL_01d1;241 case 3:242 val2 = _003C_003Eu__2;243 _003C_003Eu__2 = default(ConfiguredTaskAwaiter);244 num = (_003C_003E1__state = -1);245 goto IL_0251;246 case 4:247 {248 val = _003C_003Eu__3;249 _003C_003Eu__3 = default(ConfiguredTaskAwaiter<Diff>);250 num = (_003C_003E1__state = -1);251 break;252 }253 IL_0139:254 ((ConfiguredTaskAwaiter)(ref val2)).GetResult();255 goto IL_0258;256 IL_01d1:257 if (!string.IsNullOrEmpty(val3.GetResult()))258 {259 val4 = _DeleteShellOwnerRole(entity, parameters, cancellationToken).ConfigureAwait(false);260 val2 = ((ConfiguredTaskAwaitable)(ref val4)).GetAwaiter();261 if (!((ConfiguredTaskAwaiter)(ref val2)).IsCompleted)262 {263 num = (_003C_003E1__state = 3);264 _003C_003Eu__2 = val2;265 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnSavingAsync_003Ed__4>(ref val2, ref this);266 return;267 }268 goto IL_0251;269 }270 goto IL_0258;271 IL_00b4:272 if (string.IsNullOrEmpty(val3.GetResult()))273 {274 val4 = dPRShell._CreateShellOwnerRole_OnSaving(entity, parameters, dPRShell, cancellationToken).ConfigureAwait(false);275 val2 = ((ConfiguredTaskAwaitable)(ref val4)).GetAwaiter();276 if (!((ConfiguredTaskAwaiter)(ref val2)).IsCompleted)277 {278 num = (_003C_003E1__state = 1);279 _003C_003Eu__2 = val2;280 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnSavingAsync_003Ed__4>(ref val2, ref this);281 return;282 }283 goto IL_0139;284 }285 goto IL_0258;286 IL_0251:287 ((ConfiguredTaskAwaiter)(ref val2)).GetResult();288 goto IL_0258;289 IL_0258:290 val = ((StateBasedEntityLogic)dPRShell).OnSavingAsync(entity, parameters, cancellationToken).ConfigureAwait(false).GetAwaiter();291 if (!val.IsCompleted)292 {293 num = (_003C_003E1__state = 4);294 _003C_003Eu__3 = val;295 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<Diff>, _003COnSavingAsync_003Ed__4>(ref val, ref this);296 return;297 }298 break;299 }300 result = val.GetResult();301 }302 catch (System.Exception exception)303 {304 _003C_003E1__state = -2;305 _003C_003Et__builder.SetException(exception);306 return;307 }308 _003C_003E1__state = -2;309 _003C_003Et__builder.SetResult(result);310 }311312 [DebuggerHidden]313 private void SetStateMachine(IAsyncStateMachine stateMachine)314 {315 _003C_003Et__builder.SetStateMachine(stateMachine);316 }317 }318319 [StructLayout((LayoutKind)3)]320 [CompilerGenerated]321 private struct _003C_CheckAERoleShellOwner_003Ed__5 : IAsyncStateMachine322 {323 public int _003C_003E1__state;324325 public AsyncTaskMethodBuilder<bool> _003C_003Et__builder;326327 public string uidAERoleShellOwner;328329 public IEntity entity;330331 public ISession session;332333 public CancellationToken ct;334335 private ConfiguredTaskAwaiter<TryResult<string>> _003C_003Eu__1;336337 private void MoveNext()338 {339 //IL_00c9: Unknown result type (might be due to invalid IL or missing references)340 //IL_00ce: Unknown result type (might be due to invalid IL or missing references)341 //IL_00d6: Unknown result type (might be due to invalid IL or missing references)342 //IL_0083: Unknown result type (might be due to invalid IL or missing references)343 //IL_008e: Unknown result type (might be due to invalid IL or missing references)344 //IL_0093: Unknown result type (might be due to invalid IL or missing references)345 //IL_0097: Unknown result type (might be due to invalid IL or missing references)346 //IL_009c: Unknown result type (might be due to invalid IL or missing references)347 //IL_00b1: Unknown result type (might be due to invalid IL or missing references)348 //IL_00b3: Unknown result type (might be due to invalid IL or missing references)349 int num = _003C_003E1__state;350 bool result;351 try352 {353 ConfiguredTaskAwaiter<TryResult<string>> val;354 if (num == 0)355 {356 val = _003C_003Eu__1;357 _003C_003Eu__1 = default(ConfiguredTaskAwaiter<TryResult<string>>);358 num = (_003C_003E1__state = -1);359 goto IL_00e5;360 }361 _003C_003Ec__DisplayClass5_0 CS_0024_003C_003E8__locals2 = new _003C_003Ec__DisplayClass5_0362 {363 uidAERoleShellOwner = uidAERoleShellOwner364 };365 if (!entity.IsLoaded)366 {367 result = true;368 }369 else370 {371 if (!string.IsNullOrEmpty(CS_0024_003C_003E8__locals2.uidAERoleShellOwner))372 {373 Query query = (from c in Query.From("AERole")374 where c.Column("UID_AERole") == CS_0024_003C_003E8__locals2.uidAERoleShellOwner375 select c).Select("UID_ParentAERole");376 val = session.Source().TryGetSingleValueAsync<string>(query, ct).ConfigureAwait(false)377 .GetAwaiter();378 if (!val.IsCompleted)379 {380 num = (_003C_003E1__state = 0);381 _003C_003Eu__1 = val;382 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<TryResult<string>>, _003C_CheckAERoleShellOwner_003Ed__5>(ref val, ref this);383 return;384 }385 goto IL_00e5;386 }387 result = true;388 }389 goto end_IL_0007;390 IL_00e5:391 TryResult<string> result2 = val.GetResult();392 if (result2.Success && !string.Equals(result2.Result, UidAERoleParent))393 {394 throw new ViException(2224417, ExceptionRelevance.EndUser);395 }396 result = true;397 end_IL_0007:;398 }399 catch (System.Exception exception)400 {401 _003C_003E1__state = -2;402 _003C_003Et__builder.SetException(exception);403 return;404 }405 _003C_003E1__state = -2;406 _003C_003Et__builder.SetResult(result);407 }408409 [DebuggerHidden]410 private void SetStateMachine(IAsyncStateMachine stateMachine)411 {412 _003C_003Et__builder.SetStateMachine(stateMachine);413 }414 }415416 [StructLayout((LayoutKind)3)]417 [CompilerGenerated]418 private struct _003C_CreateShellOwnerRole_OnSaving_003Ed__3 : IAsyncStateMachine419 {420 public int _003C_003E1__state;421422 public AsyncTaskMethodBuilder _003C_003Et__builder;423424 public IEntity entity;425426 public CancellationToken ct;427428 private _003C_003Ec__DisplayClass3_0 _003C_003E8__1;429430 public LogicReadWriteParameters parameter;431432 private ConfiguredTaskAwaiter<string> _003C_003Eu__1;433434 private ConfiguredTaskAwaiter<TryResult<string>> _003C_003Eu__2;435436 private IEntity _003CeAERole_003E5__2;437438 private ConfiguredTaskAwaiter<IEntity> _003C_003Eu__3;439440 private ConfiguredValueTaskAwaiter<ApplyResult> _003C_003Eu__4;441442 private ConfiguredTaskAwaiter _003C_003Eu__5;443444 private void MoveNext()445 {446 //IL_0080: Unknown result type (might be due to invalid IL or missing references)447 //IL_0085: Unknown result type (might be due to invalid IL or missing references)448 //IL_008d: Unknown result type (might be due to invalid IL or missing references)449 //IL_013f: Unknown result type (might be due to invalid IL or missing references)450 //IL_0144: Unknown result type (might be due to invalid IL or missing references)451 //IL_014c: Unknown result type (might be due to invalid IL or missing references)452 //IL_01e7: Unknown result type (might be due to invalid IL or missing references)453 //IL_01ec: Unknown result type (might be due to invalid IL or missing references)454 //IL_01f4: Unknown result type (might be due to invalid IL or missing references)455 //IL_0278: Unknown result type (might be due to invalid IL or missing references)456 //IL_027d: Unknown result type (might be due to invalid IL or missing references)457 //IL_0285: Unknown result type (might be due to invalid IL or missing references)458 //IL_02fa: Unknown result type (might be due to invalid IL or missing references)459 //IL_02ff: Unknown result type (might be due to invalid IL or missing references)460 //IL_0307: Unknown result type (might be due to invalid IL or missing references)461 //IL_037a: Unknown result type (might be due to invalid IL or missing references)462 //IL_037f: Unknown result type (might be due to invalid IL or missing references)463 //IL_0387: Unknown result type (might be due to invalid IL or missing references)464 //IL_0037: Unknown result type (might be due to invalid IL or missing references)465 //IL_0042: Unknown result type (might be due to invalid IL or missing references)466 //IL_0047: Unknown result type (might be due to invalid IL or missing references)467 //IL_004b: Unknown result type (might be due to invalid IL or missing references)468 //IL_0050: Unknown result type (might be due to invalid IL or missing references)469 //IL_00f6: Unknown result type (might be due to invalid IL or missing references)470 //IL_0101: Unknown result type (might be due to invalid IL or missing references)471 //IL_0106: Unknown result type (might be due to invalid IL or missing references)472 //IL_010a: Unknown result type (might be due to invalid IL or missing references)473 //IL_010f: Unknown result type (might be due to invalid IL or missing references)474 //IL_022b: Unknown result type (might be due to invalid IL or missing references)475 //IL_023a: Unknown result type (might be due to invalid IL or missing references)476 //IL_023f: Unknown result type (might be due to invalid IL or missing references)477 //IL_0243: Unknown result type (might be due to invalid IL or missing references)478 //IL_0248: Unknown result type (might be due to invalid IL or missing references)479 //IL_02ad: Unknown result type (might be due to invalid IL or missing references)480 //IL_02bc: Unknown result type (might be due to invalid IL or missing references)481 //IL_02c1: Unknown result type (might be due to invalid IL or missing references)482 //IL_02c5: Unknown result type (might be due to invalid IL or missing references)483 //IL_02ca: Unknown result type (might be due to invalid IL or missing references)484 //IL_0331: Unknown result type (might be due to invalid IL or missing references)485 //IL_033c: Unknown result type (might be due to invalid IL or missing references)486 //IL_0341: Unknown result type (might be due to invalid IL or missing references)487 //IL_0345: Unknown result type (might be due to invalid IL or missing references)488 //IL_034a: Unknown result type (might be due to invalid IL or missing references)489 //IL_0065: Unknown result type (might be due to invalid IL or missing references)490 //IL_0067: Unknown result type (might be due to invalid IL or missing references)491 //IL_0124: Unknown result type (might be due to invalid IL or missing references)492 //IL_0126: Unknown result type (might be due to invalid IL or missing references)493 //IL_019e: Unknown result type (might be due to invalid IL or missing references)494 //IL_01a9: Unknown result type (might be due to invalid IL or missing references)495 //IL_01ae: Unknown result type (might be due to invalid IL or missing references)496 //IL_01b2: Unknown result type (might be due to invalid IL or missing references)497 //IL_01b7: Unknown result type (might be due to invalid IL or missing references)498 //IL_025d: Unknown result type (might be due to invalid IL or missing references)499 //IL_025f: Unknown result type (might be due to invalid IL or missing references)500 //IL_02df: Unknown result type (might be due to invalid IL or missing references)501 //IL_02e1: Unknown result type (might be due to invalid IL or missing references)502 //IL_035f: Unknown result type (might be due to invalid IL or missing references)503 //IL_0361: Unknown result type (might be due to invalid IL or missing references)504 //IL_01cc: Unknown result type (might be due to invalid IL or missing references)505 //IL_01ce: Unknown result type (might be due to invalid IL or missing references)506 int num = _003C_003E1__state;507 try508 {509 ConfiguredTaskAwaiter<string> val5;510 ConfiguredTaskAwaiter<TryResult<string>> val4;511 ConfiguredTaskAwaiter<IEntity> val3;512 ConfiguredValueTaskAwaiter<ApplyResult> val2;513 ConfiguredTaskAwaiter val;514 string result;515 Query query;516 IEntity result2;517 TryResult<string> result3;518 ConfiguredTaskAwaitable val6;519 switch (num)520 {521 default:522 _003C_003E8__1 = new _003C_003Ec__DisplayClass3_0();523 val5 = _GetAERoleDisplayNameAsync(entity, ct).ConfigureAwait(false).GetAwaiter();524 if (!val5.IsCompleted)525 {526 num = (_003C_003E1__state = 0);527 _003C_003Eu__1 = val5;528 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<string>, _003C_CreateShellOwnerRole_OnSaving_003Ed__3>(ref val5, ref this);529 return;530 }531 goto IL_009c;532 case 0:533 val5 = _003C_003Eu__1;534 _003C_003Eu__1 = default(ConfiguredTaskAwaiter<string>);535 num = (_003C_003E1__state = -1);536 goto IL_009c;537 case 1:538 val4 = _003C_003Eu__2;539 _003C_003Eu__2 = default(ConfiguredTaskAwaiter<TryResult<string>>);540 num = (_003C_003E1__state = -1);541 goto IL_015b;542 case 2:543 val3 = _003C_003Eu__3;544 _003C_003Eu__3 = default(ConfiguredTaskAwaiter<IEntity>);545 num = (_003C_003E1__state = -1);546 goto IL_0203;547 case 3:548 val2 = _003C_003Eu__4;549 _003C_003Eu__4 = default(ConfiguredValueTaskAwaiter<ApplyResult>);550 num = (_003C_003E1__state = -1);551 goto IL_0294;552 case 4:553 val2 = _003C_003Eu__4;554 _003C_003Eu__4 = default(ConfiguredValueTaskAwaiter<ApplyResult>);555 num = (_003C_003E1__state = -1);556 goto IL_0316;557 case 5:558 {559 val = _003C_003Eu__5;560 _003C_003Eu__5 = default(ConfiguredTaskAwaiter);561 num = (_003C_003E1__state = -1);562 goto IL_0396;563 }564 IL_0396:565 ((ConfiguredTaskAwaiter)(ref val)).GetResult();566 entity.PutValue("UID_AERoleShellOwner", _003CeAERole_003E5__2.GetValue<string>("UID_AERole"));567 _003CeAERole_003E5__2 = null;568 break;569 IL_009c:570 result = val5.GetResult();571 _003C_003E8__1.sDisplay = result;572 query = (from c in Query.From("AERole")573 where c.Column("UID_ParentAERole") == UidAERoleParent && c.Column("Ident_AERole") == _003C_003E8__1.sDisplay574 select c).Select("UID_AERole");575 val4 = parameter.Session.Source().TryGetSingleValueAsync<string>(query, ct).ConfigureAwait(false)576 .GetAwaiter();577 if (!val4.IsCompleted)578 {579 num = (_003C_003E1__state = 1);580 _003C_003Eu__2 = val4;581 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<TryResult<string>>, _003C_CreateShellOwnerRole_OnSaving_003Ed__3>(ref val4, ref this);582 return;583 }584 goto IL_015b;585 IL_0203:586 result2 = val3.GetResult();587 _003CeAERole_003E5__2 = result2;588 val2 = _003CeAERole_003E5__2.PutValueAsync("Ident_AERole", _003C_003E8__1.sDisplay, ct).ConfigureAwait(false).GetAwaiter();589 if (!val2.IsCompleted)590 {591 num = (_003C_003E1__state = 3);592 _003C_003Eu__4 = val2;593 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<ApplyResult>, _003C_CreateShellOwnerRole_OnSaving_003Ed__3>(ref val2, ref this);594 return;595 }596 goto IL_0294;597 IL_015b:598 result3 = val4.GetResult();599 if (result3.Success)600 {601 entity.PutValue("UID_AERoleShellOwner", result3.Result);602 break;603 }604 val3 = parameter.Session.Source().CreateNewAsync("AERole", EntityCreationType.DelayedLogic, ct).ConfigureAwait(false)605 .GetAwaiter();606 if (!val3.IsCompleted)607 {608 num = (_003C_003E1__state = 2);609 _003C_003Eu__3 = val3;610 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntity>, _003C_CreateShellOwnerRole_OnSaving_003Ed__3>(ref val3, ref this);611 return;612 }613 goto IL_0203;614 IL_0316:615 val2.GetResult();616 val6 = parameter.UnitOfWork.PutAsync(_003CeAERole_003E5__2, null, ct).ConfigureAwait(false);617 val = ((ConfiguredTaskAwaitable)(ref val6)).GetAwaiter();618 if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)619 {620 num = (_003C_003E1__state = 5);621 _003C_003Eu__5 = val;622 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003C_CreateShellOwnerRole_OnSaving_003Ed__3>(ref val, ref this);623 return;624 }625 goto IL_0396;626 IL_0294:627 val2.GetResult();628 val2 = _003CeAERole_003E5__2.PutValueAsync("UID_ParentAERole", UidAERoleParent, ct).ConfigureAwait(false).GetAwaiter();629 if (!val2.IsCompleted)630 {631 num = (_003C_003E1__state = 4);632 _003C_003Eu__4 = val2;633 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<ApplyResult>, _003C_CreateShellOwnerRole_OnSaving_003Ed__3>(ref val2, ref this);634 return;635 }636 goto IL_0316;637 }638 entity.PutValue("ShadowCopy", null);639 }640 catch (System.Exception exception)641 {642 _003C_003E1__state = -2;643 _003C_003E8__1 = null;644 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);645 return;646 }647 _003C_003E1__state = -2;648 _003C_003E8__1 = null;649 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();650 }651652 [DebuggerHidden]653 private void SetStateMachine(IAsyncStateMachine stateMachine)654 {655 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);656 }657 }658659 [StructLayout((LayoutKind)3)]660 [CompilerGenerated]661 private struct _003C_DeleteShellOwnerRole_003Ed__7 : IAsyncStateMachine662 {663 public int _003C_003E1__state;664665 public AsyncTaskMethodBuilder _003C_003Et__builder;666667 public IEntity entity;668669 public CancellationToken cancellationToken;670671 public LogicReadWriteParameters parameters;672673 private string _003CuidAERole_003E5__2;674675 private ConfiguredValueTaskAwaiter<string> _003C_003Eu__1;676677 private ConfiguredTaskAwaiter<TryResult<IEntity>> _003C_003Eu__2;678679 private ConfiguredTaskAwaiter<IDeepDelete> _003C_003Eu__3;680681 private ConfiguredTaskAwaiter _003C_003Eu__4;682683 private void MoveNext()684 {685 //IL_0084: Unknown result type (might be due to invalid IL or missing references)686 //IL_0089: Unknown result type (might be due to invalid IL or missing references)687 //IL_0091: Unknown result type (might be due to invalid IL or missing references)688 //IL_0126: Unknown result type (might be due to invalid IL or missing references)689 //IL_012b: Unknown result type (might be due to invalid IL or missing references)690 //IL_0133: Unknown result type (might be due to invalid IL or missing references)691 //IL_01ec: Unknown result type (might be due to invalid IL or missing references)692 //IL_01f1: Unknown result type (might be due to invalid IL or missing references)693 //IL_01f9: Unknown result type (might be due to invalid IL or missing references)694 //IL_027a: Unknown result type (might be due to invalid IL or missing references)695 //IL_027f: Unknown result type (might be due to invalid IL or missing references)696 //IL_0287: Unknown result type (might be due to invalid IL or missing references)697 //IL_02ef: Unknown result type (might be due to invalid IL or missing references)698 //IL_02f4: Unknown result type (might be due to invalid IL or missing references)699 //IL_02fc: Unknown result type (might be due to invalid IL or missing references)700 //IL_0037: Unknown result type (might be due to invalid IL or missing references)701 //IL_0046: Unknown result type (might be due to invalid IL or missing references)702 //IL_004b: Unknown result type (might be due to invalid IL or missing references)703 //IL_004f: Unknown result type (might be due to invalid IL or missing references)704 //IL_0054: Unknown result type (might be due to invalid IL or missing references)705 //IL_01a3: Unknown result type (might be due to invalid IL or missing references)706 //IL_01ae: Unknown result type (might be due to invalid IL or missing references)707 //IL_01b3: Unknown result type (might be due to invalid IL or missing references)708 //IL_01b7: Unknown result type (might be due to invalid IL or missing references)709 //IL_01bc: Unknown result type (might be due to invalid IL or missing references)710 //IL_02a9: Unknown result type (might be due to invalid IL or missing references)711 //IL_02b4: Unknown result type (might be due to invalid IL or missing references)712 //IL_02b9: Unknown result type (might be due to invalid IL or missing references)713 //IL_02bd: Unknown result type (might be due to invalid IL or missing references)714 //IL_02c2: Unknown result type (might be due to invalid IL or missing references)715 //IL_0069: Unknown result type (might be due to invalid IL or missing references)716 //IL_006b: Unknown result type (might be due to invalid IL or missing references)717 //IL_00d9: Unknown result type (might be due to invalid IL or missing references)718 //IL_00e8: Unknown result type (might be due to invalid IL or missing references)719 //IL_00ed: Unknown result type (might be due to invalid IL or missing references)720 //IL_00f1: Unknown result type (might be due to invalid IL or missing references)721 //IL_00f6: Unknown result type (might be due to invalid IL or missing references)722 //IL_01d1: Unknown result type (might be due to invalid IL or missing references)723 //IL_01d3: Unknown result type (might be due to invalid IL or missing references)724 //IL_0231: Unknown result type (might be due to invalid IL or missing references)725 //IL_023c: Unknown result type (might be due to invalid IL or missing references)726 //IL_0241: Unknown result type (might be due to invalid IL or missing references)727 //IL_0245: Unknown result type (might be due to invalid IL or missing references)728 //IL_024a: Unknown result type (might be due to invalid IL or missing references)729 //IL_02d7: Unknown result type (might be due to invalid IL or missing references)730 //IL_02d9: Unknown result type (might be due to invalid IL or missing references)731 //IL_010b: Unknown result type (might be due to invalid IL or missing references)732 //IL_010d: Unknown result type (might be due to invalid IL or missing references)733 //IL_025f: Unknown result type (might be due to invalid IL or missing references)734 //IL_0261: Unknown result type (might be due to invalid IL or missing references)735 int num = _003C_003E1__state;736 try737 {738 ConfiguredValueTaskAwaiter<string> val4;739 ConfiguredTaskAwaiter<TryResult<IEntity>> val3;740 ConfiguredTaskAwaiter<IDeepDelete> val2;741 ConfiguredTaskAwaiter val;742 string result;743 ISqlFormatter formatter;744 string whereClause;745 Query query;746 string result2;747 ConfiguredTaskAwaitable val5;748 TryResult<IEntity> result3;749 switch (num)750 {751 default:752 val4 = entity.Columns["UID_AERoleShellOwner"].GetValueAsync<string>(cancellationToken).ConfigureAwait(false).GetAwaiter();753 if (!val4.IsCompleted)754 {755 num = (_003C_003E1__state = 0);756 _003C_003Eu__1 = val4;757 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<string>, _003C_DeleteShellOwnerRole_003Ed__7>(ref val4, ref this);758 return;759 }760 goto IL_00a0;761 case 0:762 val4 = _003C_003Eu__1;763 _003C_003Eu__1 = default(ConfiguredValueTaskAwaiter<string>);764 num = (_003C_003E1__state = -1);765 goto IL_00a0;766 case 1:767 val4 = _003C_003Eu__1;768 _003C_003Eu__1 = default(ConfiguredValueTaskAwaiter<string>);769 num = (_003C_003E1__state = -1);770 goto IL_0142;771 case 2:772 val3 = _003C_003Eu__2;773 _003C_003Eu__2 = default(ConfiguredTaskAwaiter<TryResult<IEntity>>);774 num = (_003C_003E1__state = -1);775 goto IL_0208;776 case 3:777 val2 = _003C_003Eu__3;778 _003C_003Eu__3 = default(ConfiguredTaskAwaiter<IDeepDelete>);779 num = (_003C_003E1__state = -1);780 goto IL_0296;781 case 4:782 {783 val = _003C_003Eu__4;784 _003C_003Eu__4 = default(ConfiguredTaskAwaiter);785 num = (_003C_003E1__state = -1);786 break;787 }788 IL_0142:789 result = val4.GetResult();790 formatter = parameters.Session.SqlFormatter();791 whereClause = string.Format("UID_AERole = {0} and not exists ( select top 1 1 from DPRShell where UID_AERoleShellOwner = {0} and UID_DPRShell != {1})", (object)formatter.FormatUidValue(_003CuidAERole_003E5__2), (object)formatter.FormatUidValue(result));792 query = Query.From("AERole").Where(whereClause).SelectNone();793 val3 = parameters.Session.Source().TryGetAsync(query, cancellationToken).ConfigureAwait(false)794 .GetAwaiter();795 if (!val3.IsCompleted)796 {797 num = (_003C_003E1__state = 2);798 _003C_003Eu__2 = val3;799 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<TryResult<IEntity>>, _003C_DeleteShellOwnerRole_003Ed__7>(ref val3, ref this);800 return;801 }802 goto IL_0208;803 IL_00a0:804 result2 = val4.GetResult();805 _003CuidAERole_003E5__2 = result2;806 if (!string.IsNullOrEmpty(_003CuidAERole_003E5__2))807 {808 val4 = entity.Columns["UID_DPRShell"].GetValueAsync<string>(cancellationToken).ConfigureAwait(false).GetAwaiter();809 if (!val4.IsCompleted)810 {811 num = (_003C_003E1__state = 1);812 _003C_003Eu__1 = val4;813 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<string>, _003C_DeleteShellOwnerRole_003Ed__7>(ref val4, ref this);814 return;815 }816 goto IL_0142;817 }818 goto end_IL_0007;819 IL_0296:820 val5 = val2.GetResult().ExecuteAsync(parameters.UnitOfWork, cancellationToken).ConfigureAwait(false);821 val = ((ConfiguredTaskAwaitable)(ref val5)).GetAwaiter();822 if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)823 {824 num = (_003C_003E1__state = 4);825 _003C_003Eu__4 = val;826 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003C_DeleteShellOwnerRole_003Ed__7>(ref val, ref this);827 return;828 }829 break;830 IL_0208:831 result3 = val3.GetResult();832 if (result3.Success)833 {834 val2 = result3.Result.DeepDeleteAsync(parameters.Session, DeepDeleteBehavior.Default, cancellationToken).ConfigureAwait(false).GetAwaiter();835 if (!val2.IsCompleted)836 {837 num = (_003C_003E1__state = 3);838 _003C_003Eu__3 = val2;839 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IDeepDelete>, _003C_DeleteShellOwnerRole_003Ed__7>(ref val2, ref this);840 return;841 }842 goto IL_0296;843 }844 goto end_IL_0007;845 }846 ((ConfiguredTaskAwaiter)(ref val)).GetResult();847 end_IL_0007:;848 }849 catch (System.Exception exception)850 {851 _003C_003E1__state = -2;852 _003CuidAERole_003E5__2 = null;853 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);854 return;855 }856 _003C_003E1__state = -2;857 _003CuidAERole_003E5__2 = null;858 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();859 }860861 [DebuggerHidden]862 private void SetStateMachine(IAsyncStateMachine stateMachine)863 {864 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);865 }866 }867868 [StructLayout((LayoutKind)3)]869 [CompilerGenerated]870 private struct _003C_GetAERoleDisplayNameAsync_003Ed__6 : IAsyncStateMachine871 {872 public int _003C_003E1__state;873874 public AsyncTaskMethodBuilder<string> _003C_003Et__builder;875876 public IEntity eShell;877878 public CancellationToken ct;879880 private ConfiguredValueTaskAwaiter<string> _003C_003Eu__1;881882 private void MoveNext()883 {884 //IL_0072: Unknown result type (might be due to invalid IL or missing references)885 //IL_0077: Unknown result type (might be due to invalid IL or missing references)886 //IL_007e: Unknown result type (might be due to invalid IL or missing references)887 //IL_00fe: Unknown result type (might be due to invalid IL or missing references)888 //IL_0103: Unknown result type (might be due to invalid IL or missing references)889 //IL_010a: Unknown result type (might be due to invalid IL or missing references)890 //IL_0027: Unknown result type (might be due to invalid IL or missing references)891 //IL_0036: Unknown result type (might be due to invalid IL or missing references)892 //IL_003b: Unknown result type (might be due to invalid IL or missing references)893 //IL_003f: Unknown result type (might be due to invalid IL or missing references)894 //IL_0044: Unknown result type (might be due to invalid IL or missing references)895 //IL_00b6: Unknown result type (might be due to invalid IL or missing references)896 //IL_00c5: Unknown result type (might be due to invalid IL or missing references)897 //IL_00ca: Unknown result type (might be due to invalid IL or missing references)898 //IL_00ce: Unknown result type (might be due to invalid IL or missing references)899 //IL_00d3: Unknown result type (might be due to invalid IL or missing references)900 //IL_0058: Unknown result type (might be due to invalid IL or missing references)901 //IL_0059: Unknown result type (might be due to invalid IL or missing references)902 //IL_00e7: Unknown result type (might be due to invalid IL or missing references)903 //IL_00e8: Unknown result type (might be due to invalid IL or missing references)904 int num = _003C_003E1__state;905 string result2;906 try907 {908 ConfiguredValueTaskAwaiter<string> val;909 if (num != 0)910 {911 if (num == 1)912 {913 val = _003C_003Eu__1;914 _003C_003Eu__1 = default(ConfiguredValueTaskAwaiter<string>);915 num = (_003C_003E1__state = -1);916 goto IL_0119;917 }918 val = eShell.Columns["DisplayName"].GetValueAsync<string>(ct).ConfigureAwait(false).GetAwaiter();919 if (!val.IsCompleted)920 {921 num = (_003C_003E1__state = 0);922 _003C_003Eu__1 = val;923 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<string>, _003C_GetAERoleDisplayNameAsync_003Ed__6>(ref val, ref this);924 return;925 }926 }927 else928 {929 val = _003C_003Eu__1;930 _003C_003Eu__1 = default(ConfiguredValueTaskAwaiter<string>);931 num = (_003C_003E1__state = -1);932 }933 string result = val.GetResult();934 if (string.IsNullOrWhiteSpace(result))935 {936 val = eShell.Columns["Name"].GetValueAsync<string>(ct).ConfigureAwait(false).GetAwaiter();937 if (!val.IsCompleted)938 {939 num = (_003C_003E1__state = 1);940 _003C_003Eu__1 = val;941 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<string>, _003C_GetAERoleDisplayNameAsync_003Ed__6>(ref val, ref this);942 return;943 }944 goto IL_0119;945 }946 goto IL_0121;947 IL_0119:948 result = val.GetResult();949 goto IL_0121;950 IL_0121:951 result2 = result;952 }953 catch (System.Exception exception)954 {955 _003C_003E1__state = -2;956 _003C_003Et__builder.SetException(exception);957 return;958 }959 _003C_003E1__state = -2;960 _003C_003Et__builder.SetResult(result2);961 }962963 [DebuggerHidden]964 private void SetStateMachine(IAsyncStateMachine stateMachine)965 {966 _003C_003Et__builder.SetStateMachine(stateMachine);967 }968 }969970 private static readonly string UidAERoleParent = "QER-b14345b05a314929bb3a52aef0936c6c";971972 public DPRShell()973 {974 RegisterExtendedMethod("CreateShellOwnerRole").As<object>((Func<ISession, IEntity, CancellationToken, System.Threading.Tasks.Task<object>>)CreateShellOwnerRole).OnSaving(_CreateShellOwnerRole_OnSaving).NeedsSaving()975 .Behavior(MethodBehavior.SaveRequired)976 .Description("Method_CreateShellOwnerRole")977 .Enabled()978 .Default(value: false)979 .Enabled()980 .From("[IsLoaded]", "UID_AERoleShellOwner")981 .As<bool, string>((Func<bool, string, bool>)((bool isLoaded, string uid) => isLoaded && string.IsNullOrEmpty(uid)))982 .Visible()983 .Default(value: false)984 .Visible()985 .From("[IsLoaded]", "UID_AERoleShellOwner")986 .As<bool, string>((Func<bool, string, bool>)((bool isLoaded, string uid) => isLoaded && string.IsNullOrEmpty(uid)));987 Check("UID_AERoleShellOwner").AsExpensive<string>((Func<ISession, IEntity, string, CancellationToken, System.Threading.Tasks.Task<bool>>)_CheckAERoleShellOwner);988 }989990 [AsyncStateMachine(typeof(_003CCreateShellOwnerRole_003Ed__2))]991 private async System.Threading.Tasks.Task<object> CreateShellOwnerRole(ISession session, IEntity entity, CancellationToken ct)992 {993 //IL_0002: Unknown result type (might be due to invalid IL or missing references)994 //IL_0007: Unknown result type (might be due to invalid IL or missing references)995 //IL_0026: Unknown result type (might be due to invalid IL or missing references)996 //IL_0027: Unknown result type (might be due to invalid IL or missing references)997 if (!string.IsNullOrEmpty(await entity.Columns["UID_AERoleShellOwner"].GetValueAsync<string>(ct).ConfigureAwait(false)))998 {999 string translated = session.MetaData().GetTable(entity.Tablename).Columns["UID_AERoleShellOwner"].Display.Translated;1000 throw new ViException(2224416, ExceptionRelevance.EndUser, translated);1001 }1002 return this;1003 }10041005 [AsyncStateMachine(typeof(_003C_CreateShellOwnerRole_OnSaving_003Ed__3))]1006 private System.Threading.Tasks.Task _CreateShellOwnerRole_OnSaving(IEntity entity, LogicReadWriteParameters parameter, object o, CancellationToken ct = default(CancellationToken))1007 {1008 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1009 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1010 //IL_001e: Unknown result type (might be due to invalid IL or missing references)1011 //IL_0020: Unknown result type (might be due to invalid IL or missing references)1012 _003C_CreateShellOwnerRole_OnSaving_003Ed__3 _003C_CreateShellOwnerRole_OnSaving_003Ed__ = default(_003C_CreateShellOwnerRole_OnSaving_003Ed__3);1013 _003C_CreateShellOwnerRole_OnSaving_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();1014 _003C_CreateShellOwnerRole_OnSaving_003Ed__.entity = entity;1015 _003C_CreateShellOwnerRole_OnSaving_003Ed__.parameter = parameter;1016 _003C_CreateShellOwnerRole_OnSaving_003Ed__.ct = ct;1017 _003C_CreateShellOwnerRole_OnSaving_003Ed__._003C_003E1__state = -1;1018 ((AsyncTaskMethodBuilder)(ref _003C_CreateShellOwnerRole_OnSaving_003Ed__._003C_003Et__builder)).Start<_003C_CreateShellOwnerRole_OnSaving_003Ed__3>(ref _003C_CreateShellOwnerRole_OnSaving_003Ed__);1019 return ((AsyncTaskMethodBuilder)(ref _003C_CreateShellOwnerRole_OnSaving_003Ed__._003C_003Et__builder)).Task;1020 }10211022 [AsyncStateMachine(typeof(_003COnSavingAsync_003Ed__4))]1023 public override async System.Threading.Tasks.Task<Diff> OnSavingAsync(IEntity entity, LogicReadWriteParameters parameters, CancellationToken cancellationToken)1024 {1025 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1026 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1027 //IL_0026: Unknown result type (might be due to invalid IL or missing references)1028 //IL_0027: Unknown result type (might be due to invalid IL or missing references)1029 if (!entity.IsLoaded)1030 {1031 if (string.IsNullOrEmpty(await entity.Columns["UID_AERoleShellOwner"].GetValueAsync<string>(cancellationToken).ConfigureAwait(false)))1032 {1033 await _CreateShellOwnerRole_OnSaving(entity, parameters, this, cancellationToken).ConfigureAwait(false);1034 }1035 }1036 else if (entity.IsToDelete() && !string.IsNullOrEmpty(await entity.Columns["UID_AERoleShellOwner"].GetValueAsync<string>(cancellationToken).ConfigureAwait(false)))1037 {1038 await _DeleteShellOwnerRole(entity, parameters, cancellationToken).ConfigureAwait(false);1039 }1040 return await base.OnSavingAsync(entity, parameters, cancellationToken).ConfigureAwait(false);1041 }10421043 [AsyncStateMachine(typeof(_003C_CheckAERoleShellOwner_003Ed__5))]1044 private static async System.Threading.Tasks.Task<bool> _CheckAERoleShellOwner(ISession session, IEntity entity, string uidAERoleShellOwner, CancellationToken ct)1045 {1046 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1047 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1048 //IL_0026: Unknown result type (might be due to invalid IL or missing references)1049 //IL_0027: Unknown result type (might be due to invalid IL or missing references)1050 if (!entity.IsLoaded)1051 {1052 return true;1053 }1054 if (string.IsNullOrEmpty(uidAERoleShellOwner))1055 {1056 return true;1057 }1058 Query query = (from c in Query.From("AERole")1059 where c.Column("UID_AERole") == uidAERoleShellOwner1060 select c).Select("UID_ParentAERole");1061 TryResult<string> tryResult = await session.Source().TryGetSingleValueAsync<string>(query, ct).ConfigureAwait(false);1062 if (tryResult.Success && !string.Equals(tryResult.Result, UidAERoleParent))1063 {1064 throw new ViException(2224417, ExceptionRelevance.EndUser);1065 }1066 return true;1067 }10681069 [AsyncStateMachine(typeof(_003C_GetAERoleDisplayNameAsync_003Ed__6))]1070 private static async System.Threading.Tasks.Task<string> _GetAERoleDisplayNameAsync(IEntity eShell, CancellationToken ct)1071 {1072 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1073 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1074 //IL_0016: Unknown result type (might be due to invalid IL or missing references)1075 //IL_0017: Unknown result type (might be due to invalid IL or missing references)1076 string text = await eShell.Columns["DisplayName"].GetValueAsync<string>(ct).ConfigureAwait(false);1077 if (string.IsNullOrWhiteSpace(text))1078 {1079 text = await eShell.Columns["Name"].GetValueAsync<string>(ct).ConfigureAwait(false);1080 }1081 return text;1082 }10831084 [AsyncStateMachine(typeof(_003C_DeleteShellOwnerRole_003Ed__7))]1085 private static System.Threading.Tasks.Task _DeleteShellOwnerRole(IEntity entity, LogicReadWriteParameters parameters, CancellationToken cancellationToken)1086 {1087 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1088 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1089 //IL_001e: Unknown result type (might be due to invalid IL or missing references)1090 //IL_001f: Unknown result type (might be due to invalid IL or missing references)1091 _003C_DeleteShellOwnerRole_003Ed__7 _003C_DeleteShellOwnerRole_003Ed__ = default(_003C_DeleteShellOwnerRole_003Ed__7);1092 _003C_DeleteShellOwnerRole_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();1093 _003C_DeleteShellOwnerRole_003Ed__.entity = entity;1094 _003C_DeleteShellOwnerRole_003Ed__.parameters = parameters;1095 _003C_DeleteShellOwnerRole_003Ed__.cancellationToken = cancellationToken;1096 _003C_DeleteShellOwnerRole_003Ed__._003C_003E1__state = -1;1097 ((AsyncTaskMethodBuilder)(ref _003C_DeleteShellOwnerRole_003Ed__._003C_003Et__builder)).Start<_003C_DeleteShellOwnerRole_003Ed__7>(ref _003C_DeleteShellOwnerRole_003Ed__);1098 return ((AsyncTaskMethodBuilder)(ref _003C_DeleteShellOwnerRole_003Ed__._003C_003Et__builder)).Task;1099 }1100}1101