TSB.Customizer/TSB.Customizer/DirectoryObjectEntityLogic.cs
Decompiler Source FileTSB.Customizer.DirectoryObjectEntityLogicDecompiled 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: Move at line 1123
- ExtendedMethod registration: Move at line 1130
- CustomGenerated event: Move at line 1105
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
Summary: classes DirectoryObjectEntityLogic, _003C_003Ec__DisplayClass5_0, _003C_003Ec__DisplayClass7_0; methods _003C_CheckParent_003Eb__0, _003C_CheckContainer_003Eb__0, MoveNext, SetStateMachine, OnSavingAsync, _CheckStructuralObjectClass; markers reads entity values
Classes
DirectoryObjectEntityLogic _003C_003Ec__DisplayClass5_0 _003C_003Ec__DisplayClass7_0Methods
DB/Dialog object references
None extracted.
OIM key/entity markers
None extracted.API/entity calls
GetValue GetValueAsync TryResult SetValue IsFullSync IsDeleted GetValue From SourceRegistrations / handlers
None extracted.
Complete Source
1using System;2using System.Collections.Generic;3using System.Diagnostics;4using System.Linq;5using System.Runtime.CompilerServices;6using System.Runtime.InteropServices;7using System.Threading;8using System.Threading.Tasks;9using QER.Customizer;10using VI.Base;11using VI.DB;12using VI.DB.Entities;13using VI.DB.MetaData;14using VI.TargetSystem.Base.Utils.LDAP;1516namespace TSB.Customizer;1718public class DirectoryObjectEntityLogic : StateBasedEntityLogic19{20 [CompilerGenerated]21 private sealed class _003C_003Ec__DisplayClass5_022 {23 public IMetaTableRelation fkContainer;2425 public string uidNewParent;2627 internal ExpressionClause _003C_CheckParent_003Eb__0(IExpressionContext c)28 {29 return c.Column(fkContainer.ParentColumnName) == uidNewParent;30 }31 }3233 [CompilerGenerated]34 private sealed class _003C_003Ec__DisplayClass7_035 {36 public IMetaTableRelation fkContainer;3738 public string uidContainer;3940 internal ExpressionClause _003C_CheckContainer_003Eb__0(IExpressionContext c)41 {42 return c.Column(fkContainer.ChildColumnName) == uidContainer;43 }44 }4546 [StructLayout((LayoutKind)3)]47 [CompilerGenerated]48 private struct _003CMoveContainer_003Ed__8 : IAsyncStateMachine49 {50 public int _003C_003E1__state;5152 public AsyncTaskMethodBuilder<string> _003C_003Et__builder;5354 public string uidNewParent;5556 public DirectoryObjectEntityLogic _003C_003E4__this;5758 public ISession session;5960 public IEntity entity;6162 public CancellationToken ct;6364 private ConfiguredTaskAwaiter<bool> _003C_003Eu__1;6566 private void MoveNext()67 {68 //IL_0076: Unknown result type (might be due to invalid IL or missing references)69 //IL_007b: Unknown result type (might be due to invalid IL or missing references)70 //IL_0082: Unknown result type (might be due to invalid IL or missing references)71 //IL_0032: Unknown result type (might be due to invalid IL or missing references)72 //IL_003d: Unknown result type (might be due to invalid IL or missing references)73 //IL_0042: Unknown result type (might be due to invalid IL or missing references)74 //IL_0046: Unknown result type (might be due to invalid IL or missing references)75 //IL_004b: Unknown result type (might be due to invalid IL or missing references)76 //IL_005f: Unknown result type (might be due to invalid IL or missing references)77 //IL_0060: Unknown result type (might be due to invalid IL or missing references)78 int num = _003C_003E1__state;79 DirectoryObjectEntityLogic directoryObjectEntityLogic = _003C_003E4__this;80 string result;81 try82 {83 ConfiguredTaskAwaiter<bool> val;84 if (num != 0)85 {86 if (string.IsNullOrEmpty(uidNewParent))87 {88 goto IL_0099;89 }90 val = directoryObjectEntityLogic._CheckParent(session, entity, uidNewParent, ct).ConfigureAwait(false).GetAwaiter();91 if (!val.IsCompleted)92 {93 num = (_003C_003E1__state = 0);94 _003C_003Eu__1 = val;95 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<bool>, _003CMoveContainer_003Ed__8>(ref val, ref this);96 return;97 }98 }99 else100 {101 val = _003C_003Eu__1;102 _003C_003Eu__1 = default(ConfiguredTaskAwaiter<bool>);103 num = (_003C_003E1__state = -1);104 }105 val.GetResult();106 goto IL_0099;107 IL_0099:108 result = uidNewParent;109 }110 catch (System.Exception exception)111 {112 _003C_003E1__state = -2;113 _003C_003Et__builder.SetException(exception);114 return;115 }116 _003C_003E1__state = -2;117 _003C_003Et__builder.SetResult(result);118 }119120 [DebuggerHidden]121 private void SetStateMachine(IAsyncStateMachine stateMachine)122 {123 _003C_003Et__builder.SetStateMachine(stateMachine);124 }125 }126127 [StructLayout((LayoutKind)3)]128 [CompilerGenerated]129 private struct _003CMoveObject_003Ed__9 : IAsyncStateMachine130 {131 public int _003C_003E1__state;132133 public AsyncTaskMethodBuilder<string> _003C_003Et__builder;134135 public string uidNewContainer;136137 public DirectoryObjectEntityLogic _003C_003E4__this;138139 public ISession session;140141 public IEntity entity;142143 public CancellationToken ct;144145 private ConfiguredTaskAwaiter<bool> _003C_003Eu__1;146147 private void MoveNext()148 {149 //IL_0076: Unknown result type (might be due to invalid IL or missing references)150 //IL_007b: Unknown result type (might be due to invalid IL or missing references)151 //IL_0082: Unknown result type (might be due to invalid IL or missing references)152 //IL_0032: Unknown result type (might be due to invalid IL or missing references)153 //IL_003d: Unknown result type (might be due to invalid IL or missing references)154 //IL_0042: Unknown result type (might be due to invalid IL or missing references)155 //IL_0046: Unknown result type (might be due to invalid IL or missing references)156 //IL_004b: Unknown result type (might be due to invalid IL or missing references)157 //IL_005f: Unknown result type (might be due to invalid IL or missing references)158 //IL_0060: Unknown result type (might be due to invalid IL or missing references)159 int num = _003C_003E1__state;160 DirectoryObjectEntityLogic directoryObjectEntityLogic = _003C_003E4__this;161 string result;162 try163 {164 ConfiguredTaskAwaiter<bool> val;165 if (num != 0)166 {167 if (string.IsNullOrEmpty(uidNewContainer))168 {169 goto IL_0099;170 }171 val = directoryObjectEntityLogic._CheckContainer(session, entity, uidNewContainer, ct).ConfigureAwait(false).GetAwaiter();172 if (!val.IsCompleted)173 {174 num = (_003C_003E1__state = 0);175 _003C_003Eu__1 = val;176 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<bool>, _003CMoveObject_003Ed__9>(ref val, ref this);177 return;178 }179 }180 else181 {182 val = _003C_003Eu__1;183 _003C_003Eu__1 = default(ConfiguredTaskAwaiter<bool>);184 num = (_003C_003E1__state = -1);185 }186 val.GetResult();187 goto IL_0099;188 IL_0099:189 result = uidNewContainer;190 }191 catch (System.Exception exception)192 {193 _003C_003E1__state = -2;194 _003C_003Et__builder.SetException(exception);195 return;196 }197 _003C_003E1__state = -2;198 _003C_003Et__builder.SetResult(result);199 }200201 [DebuggerHidden]202 private void SetStateMachine(IAsyncStateMachine stateMachine)203 {204 _003C_003Et__builder.SetStateMachine(stateMachine);205 }206 }207208 [StructLayout((LayoutKind)3)]209 [CompilerGenerated]210 private struct _003CMove_OnSaving_003Ed__10 : IAsyncStateMachine211 {212 public int _003C_003E1__state;213214 public AsyncTaskMethodBuilder _003C_003Et__builder;215216 public DirectoryObjectEntityLogic _003C_003E4__this;217218 public IEntity entity;219220 public string uidNewParent;221222 public LogicReadWriteParameters parameter;223224 public CancellationToken ct;225226 private ConfiguredTaskAwaiter _003C_003Eu__1;227228 private void MoveNext()229 {230 //IL_0116: Unknown result type (might be due to invalid IL or missing references)231 //IL_011b: Unknown result type (might be due to invalid IL or missing references)232 //IL_0122: Unknown result type (might be due to invalid IL or missing references)233 //IL_00d2: Unknown result type (might be due to invalid IL or missing references)234 //IL_00dd: Unknown result type (might be due to invalid IL or missing references)235 //IL_00e2: Unknown result type (might be due to invalid IL or missing references)236 //IL_00e6: Unknown result type (might be due to invalid IL or missing references)237 //IL_00eb: Unknown result type (might be due to invalid IL or missing references)238 //IL_00ff: Unknown result type (might be due to invalid IL or missing references)239 //IL_0100: Unknown result type (might be due to invalid IL or missing references)240 int num = _003C_003E1__state;241 DirectoryObjectEntityLogic directoryObjectEntityLogic = _003C_003E4__this;242 try243 {244 ConfiguredTaskAwaiter val3;245 if (num != 0)246 {247 Dictionary<string, object> val = new Dictionary<string, object>((IEqualityComparer<string>)(object)StringComparer.OrdinalIgnoreCase);248 if (!string.IsNullOrEmpty(directoryObjectEntityLogic._cmParams.ParentContainer))249 {250 entity.SetValue(directoryObjectEntityLogic._cmParams.ParentContainer, uidNewParent);251 val.Add(directoryObjectEntityLogic._cmParams.ParentContainer, (object)uidNewParent);252 }253 else254 {255 entity.SetValue(directoryObjectEntityLogic._cmParams.Container, uidNewParent);256 val.Add(directoryObjectEntityLogic._cmParams.Container, (object)uidNewParent);257 }258 parameter.Session.Variables.Put("MOVE", true);259 ConfiguredTaskAwaitable val2 = parameter.UnitOfWork.GenerateAsync(entity, "Move", (IDictionary<string, object>)(object)val, ct).ConfigureAwait(false);260 val3 = ((ConfiguredTaskAwaitable)(ref val2)).GetAwaiter();261 if (!((ConfiguredTaskAwaiter)(ref val3)).IsCompleted)262 {263 num = (_003C_003E1__state = 0);264 _003C_003Eu__1 = val3;265 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003CMove_OnSaving_003Ed__10>(ref val3, ref this);266 return;267 }268 }269 else270 {271 val3 = _003C_003Eu__1;272 _003C_003Eu__1 = default(ConfiguredTaskAwaiter);273 num = (_003C_003E1__state = -1);274 }275 ((ConfiguredTaskAwaiter)(ref val3)).GetResult();276 parameter.Session.Variables.Put("MOVE", false);277 }278 catch (System.Exception exception)279 {280 _003C_003E1__state = -2;281 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);282 return;283 }284 _003C_003E1__state = -2;285 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();286 }287288 [DebuggerHidden]289 private void SetStateMachine(IAsyncStateMachine stateMachine)290 {291 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);292 }293 }294295 [StructLayout((LayoutKind)3)]296 [CompilerGenerated]297 private struct _003COnSavingAsync_003Ed__2 : IAsyncStateMachine298 {299 public int _003C_003E1__state;300301 public AsyncTaskMethodBuilder<Diff> _003C_003Et__builder;302303 public LogicReadWriteParameters parameters;304305 public DirectoryObjectEntityLogic _003C_003E4__this;306307 public IEntity entity;308309 public CancellationToken ct;310311 private ConfiguredTaskAwaiter _003C_003Eu__1;312313 private ConfiguredTaskAwaiter<bool> _003C_003Eu__2;314315 private ConfiguredTaskAwaiter<Diff> _003C_003Eu__3;316317 private void MoveNext()318 {319 //IL_0097: Unknown result type (might be due to invalid IL or missing references)320 //IL_009c: Unknown result type (might be due to invalid IL or missing references)321 //IL_00a3: Unknown result type (might be due to invalid IL or missing references)322 //IL_0140: Unknown result type (might be due to invalid IL or missing references)323 //IL_0145: Unknown result type (might be due to invalid IL or missing references)324 //IL_014d: Unknown result type (might be due to invalid IL or missing references)325 //IL_01f0: Unknown result type (might be due to invalid IL or missing references)326 //IL_01f5: Unknown result type (might be due to invalid IL or missing references)327 //IL_01fd: Unknown result type (might be due to invalid IL or missing references)328 //IL_02cd: Unknown result type (might be due to invalid IL or missing references)329 //IL_02d2: Unknown result type (might be due to invalid IL or missing references)330 //IL_02d9: Unknown result type (might be due to invalid IL or missing references)331 //IL_0343: Unknown result type (might be due to invalid IL or missing references)332 //IL_0348: Unknown result type (might be due to invalid IL or missing references)333 //IL_0350: Unknown result type (might be due to invalid IL or missing references)334 //IL_02fd: Unknown result type (might be due to invalid IL or missing references)335 //IL_0308: Unknown result type (might be due to invalid IL or missing references)336 //IL_030d: Unknown result type (might be due to invalid IL or missing references)337 //IL_0311: Unknown result type (might be due to invalid IL or missing references)338 //IL_0316: Unknown result type (might be due to invalid IL or missing references)339 //IL_0050: Unknown result type (might be due to invalid IL or missing references)340 //IL_005b: Unknown result type (might be due to invalid IL or missing references)341 //IL_0060: Unknown result type (might be due to invalid IL or missing references)342 //IL_0064: Unknown result type (might be due to invalid IL or missing references)343 //IL_0069: Unknown result type (might be due to invalid IL or missing references)344 //IL_00f7: Unknown result type (might be due to invalid IL or missing references)345 //IL_0102: Unknown result type (might be due to invalid IL or missing references)346 //IL_0107: Unknown result type (might be due to invalid IL or missing references)347 //IL_010b: Unknown result type (might be due to invalid IL or missing references)348 //IL_0110: Unknown result type (might be due to invalid IL or missing references)349 //IL_032b: Unknown result type (might be due to invalid IL or missing references)350 //IL_032d: Unknown result type (might be due to invalid IL or missing references)351 //IL_007d: Unknown result type (might be due to invalid IL or missing references)352 //IL_007e: Unknown result type (might be due to invalid IL or missing references)353 //IL_01a7: Unknown result type (might be due to invalid IL or missing references)354 //IL_01b2: Unknown result type (might be due to invalid IL or missing references)355 //IL_01b7: Unknown result type (might be due to invalid IL or missing references)356 //IL_01bb: Unknown result type (might be due to invalid IL or missing references)357 //IL_01c0: Unknown result type (might be due to invalid IL or missing references)358 //IL_0125: Unknown result type (might be due to invalid IL or missing references)359 //IL_0127: Unknown result type (might be due to invalid IL or missing references)360 //IL_01d5: Unknown result type (might be due to invalid IL or missing references)361 //IL_01d7: Unknown result type (might be due to invalid IL or missing references)362 //IL_0286: Unknown result type (might be due to invalid IL or missing references)363 //IL_0291: Unknown result type (might be due to invalid IL or missing references)364 //IL_0296: Unknown result type (might be due to invalid IL or missing references)365 //IL_029a: Unknown result type (might be due to invalid IL or missing references)366 //IL_029f: Unknown result type (might be due to invalid IL or missing references)367 //IL_02b3: Unknown result type (might be due to invalid IL or missing references)368 //IL_02b4: Unknown result type (might be due to invalid IL or missing references)369 int num = _003C_003E1__state;370 DirectoryObjectEntityLogic directoryObjectEntityLogic = _003C_003E4__this;371 Diff result;372 try373 {374 ConfiguredTaskAwaitable val4;375 ConfiguredTaskAwaiter val2;376 ConfiguredTaskAwaiter<bool> val3;377 ConfiguredTaskAwaiter<Diff> val;378 switch (num)379 {380 default:381 if (!parameters.Session.IsFullSync())382 {383 val4 = directoryObjectEntityLogic._CheckDistinguishedName(parameters.Session, entity, ct).ConfigureAwait(false);384 val2 = ((ConfiguredTaskAwaitable)(ref val4)).GetAwaiter();385 if (!((ConfiguredTaskAwaiter)(ref val2)).IsCompleted)386 {387 num = (_003C_003E1__state = 0);388 _003C_003Eu__1 = val2;389 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnSavingAsync_003Ed__2>(ref val2, ref this);390 return;391 }392 goto IL_00b2;393 }394 goto IL_02ef;395 case 0:396 val2 = _003C_003Eu__1;397 _003C_003Eu__1 = default(ConfiguredTaskAwaiter);398 num = (_003C_003E1__state = -1);399 goto IL_00b2;400 case 1:401 val3 = _003C_003Eu__2;402 _003C_003Eu__2 = default(ConfiguredTaskAwaiter<bool>);403 num = (_003C_003E1__state = -1);404 goto IL_015c;405 case 2:406 val3 = _003C_003Eu__2;407 _003C_003Eu__2 = default(ConfiguredTaskAwaiter<bool>);408 num = (_003C_003E1__state = -1);409 goto IL_020c;410 case 3:411 val2 = _003C_003Eu__1;412 _003C_003Eu__1 = default(ConfiguredTaskAwaiter);413 num = (_003C_003E1__state = -1);414 goto IL_02e8;415 case 4:416 {417 val = _003C_003Eu__3;418 _003C_003Eu__3 = default(ConfiguredTaskAwaiter<Diff>);419 num = (_003C_003E1__state = -1);420 break;421 }422 IL_020c:423 val3.GetResult();424 goto IL_0214;425 IL_02e8:426 ((ConfiguredTaskAwaiter)(ref val2)).GetResult();427 goto IL_02ef;428 IL_00b2:429 ((ConfiguredTaskAwaiter)(ref val2)).GetResult();430 if (!string.IsNullOrEmpty(directoryObjectEntityLogic._cmParams.ParentContainer))431 {432 val3 = directoryObjectEntityLogic._CheckParent(parameters.Session, entity, entity.GetValue<string>(directoryObjectEntityLogic._cmParams.ParentContainer), ct).ConfigureAwait(false).GetAwaiter();433 if (!val3.IsCompleted)434 {435 num = (_003C_003E1__state = 1);436 _003C_003Eu__2 = val3;437 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<bool>, _003COnSavingAsync_003Ed__2>(ref val3, ref this);438 return;439 }440 goto IL_015c;441 }442 if (!string.IsNullOrEmpty(directoryObjectEntityLogic._cmParams.Container))443 {444 val3 = directoryObjectEntityLogic._CheckContainer(parameters.Session, entity, entity.GetValue<string>(directoryObjectEntityLogic._cmParams.Container), ct).ConfigureAwait(false).GetAwaiter();445 if (!val3.IsCompleted)446 {447 num = (_003C_003E1__state = 2);448 _003C_003Eu__2 = val3;449 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<bool>, _003COnSavingAsync_003Ed__2>(ref val3, ref this);450 return;451 }452 goto IL_020c;453 }454 goto IL_0214;455 IL_02ef:456 val = ((StateBasedEntityLogic)directoryObjectEntityLogic).OnSavingAsync(entity, parameters, ct).ConfigureAwait(false).GetAwaiter();457 if (!val.IsCompleted)458 {459 num = (_003C_003E1__state = 4);460 _003C_003Eu__3 = val;461 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<Diff>, _003COnSavingAsync_003Ed__2>(ref val, ref this);462 return;463 }464 break;465 IL_0214:466 if (!entity.IsDeleted() && parameters.Table.Columns.Contains("StructuralObjectClass") && parameters.Table.Columns.Contains("ObjectClass"))467 {468 val4 = directoryObjectEntityLogic._CheckStructuralObjectClass(parameters.Table, entity, parameters.CreateWalker(entity), ct).ConfigureAwait(false);469 val2 = ((ConfiguredTaskAwaitable)(ref val4)).GetAwaiter();470 if (!((ConfiguredTaskAwaiter)(ref val2)).IsCompleted)471 {472 num = (_003C_003E1__state = 3);473 _003C_003Eu__1 = val2;474 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnSavingAsync_003Ed__2>(ref val2, ref this);475 return;476 }477 goto IL_02e8;478 }479 goto IL_02ef;480 IL_015c:481 val3.GetResult();482 goto IL_0214;483 }484 result = val.GetResult();485 }486 catch (System.Exception exception)487 {488 _003C_003E1__state = -2;489 _003C_003Et__builder.SetException(exception);490 return;491 }492 _003C_003E1__state = -2;493 _003C_003Et__builder.SetResult(result);494 }495496 [DebuggerHidden]497 private void SetStateMachine(IAsyncStateMachine stateMachine)498 {499 _003C_003Et__builder.SetStateMachine(stateMachine);500 }501 }502503 [StructLayout((LayoutKind)3)]504 [CompilerGenerated]505 private struct _003C_CheckContainer_003Ed__6 : IAsyncStateMachine506 {507 public int _003C_003E1__state;508509 public AsyncTaskMethodBuilder<bool> _003C_003Et__builder;510511 public IEntity entity;512513 public DirectoryObjectEntityLogic _003C_003E4__this;514515 public ISession session;516517 public string uidContainer;518519 public CancellationToken ct;520521 private ConfiguredTaskAwaiter<bool> _003C_003Eu__1;522523 private void MoveNext()524 {525 //IL_0082: Unknown result type (might be due to invalid IL or missing references)526 //IL_0087: Unknown result type (might be due to invalid IL or missing references)527 //IL_008f: Unknown result type (might be due to invalid IL or missing references)528 //IL_003c: Unknown result type (might be due to invalid IL or missing references)529 //IL_0047: Unknown result type (might be due to invalid IL or missing references)530 //IL_004c: Unknown result type (might be due to invalid IL or missing references)531 //IL_0050: Unknown result type (might be due to invalid IL or missing references)532 //IL_0055: Unknown result type (might be due to invalid IL or missing references)533 //IL_006a: Unknown result type (might be due to invalid IL or missing references)534 //IL_006c: Unknown result type (might be due to invalid IL or missing references)535 int num = _003C_003E1__state;536 DirectoryObjectEntityLogic directoryObjectEntityLogic = _003C_003E4__this;537 bool result;538 try539 {540 ConfiguredTaskAwaiter<bool> val;541 if (num != 0)542 {543 string uidDomain = entity.GetValue(directoryObjectEntityLogic._cmParams.Domain);544 val = directoryObjectEntityLogic._CheckContainer(session, uidDomain, uidContainer, ct).ConfigureAwait(false).GetAwaiter();545 if (!val.IsCompleted)546 {547 num = (_003C_003E1__state = 0);548 _003C_003Eu__1 = val;549 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<bool>, _003C_CheckContainer_003Ed__6>(ref val, ref this);550 return;551 }552 }553 else554 {555 val = _003C_003Eu__1;556 _003C_003Eu__1 = default(ConfiguredTaskAwaiter<bool>);557 num = (_003C_003E1__state = -1);558 }559 result = val.GetResult();560 }561 catch (System.Exception exception)562 {563 _003C_003E1__state = -2;564 _003C_003Et__builder.SetException(exception);565 return;566 }567 _003C_003E1__state = -2;568 _003C_003Et__builder.SetResult(result);569 }570571 [DebuggerHidden]572 private void SetStateMachine(IAsyncStateMachine stateMachine)573 {574 _003C_003Et__builder.SetStateMachine(stateMachine);575 }576 }577578 [StructLayout((LayoutKind)3)]579 [CompilerGenerated]580 private struct _003C_CheckContainer_003Ed__7 : IAsyncStateMachine581 {582 public int _003C_003E1__state;583584 public AsyncTaskMethodBuilder<bool> _003C_003Et__builder;585586 public string uidContainer;587588 public string uidDomain;589590 public DirectoryObjectEntityLogic _003C_003E4__this;591592 public CancellationToken ct;593594 private _003C_003Ec__DisplayClass7_0 _003C_003E8__1;595596 public ISession session;597598 private ConfiguredTaskAwaiter<IMetaTableRelation> _003C_003Eu__1;599600 private ConfiguredTaskAwaiter<string> _003C_003Eu__2;601602 private void MoveNext()603 {604 //IL_00cc: Unknown result type (might be due to invalid IL or missing references)605 //IL_00d1: Unknown result type (might be due to invalid IL or missing references)606 //IL_00d9: Unknown result type (might be due to invalid IL or missing references)607 //IL_0150: Unknown result type (might be due to invalid IL or missing references)608 //IL_015b: Unknown result type (might be due to invalid IL or missing references)609 //IL_0160: Unknown result type (might be due to invalid IL or missing references)610 //IL_0164: Unknown result type (might be due to invalid IL or missing references)611 //IL_0169: Unknown result type (might be due to invalid IL or missing references)612 //IL_0199: Unknown result type (might be due to invalid IL or missing references)613 //IL_019e: Unknown result type (might be due to invalid IL or missing references)614 //IL_01a6: Unknown result type (might be due to invalid IL or missing references)615 //IL_017e: Unknown result type (might be due to invalid IL or missing references)616 //IL_0180: Unknown result type (might be due to invalid IL or missing references)617 //IL_0083: Unknown result type (might be due to invalid IL or missing references)618 //IL_008e: Unknown result type (might be due to invalid IL or missing references)619 //IL_0093: Unknown result type (might be due to invalid IL or missing references)620 //IL_0097: Unknown result type (might be due to invalid IL or missing references)621 //IL_009c: Unknown result type (might be due to invalid IL or missing references)622 //IL_00b1: Unknown result type (might be due to invalid IL or missing references)623 //IL_00b3: Unknown result type (might be due to invalid IL or missing references)624 int num = _003C_003E1__state;625 DirectoryObjectEntityLogic directoryObjectEntityLogic = _003C_003E4__this;626 bool result;627 try628 {629 ConfiguredTaskAwaiter<IMetaTableRelation> val;630 if (num == 0)631 {632 val = _003C_003Eu__1;633 _003C_003Eu__1 = default(ConfiguredTaskAwaiter<IMetaTableRelation>);634 num = (_003C_003E1__state = -1);635 goto IL_00e8;636 }637 ConfiguredTaskAwaiter<string> val2;638 if (num == 1)639 {640 val2 = _003C_003Eu__2;641 _003C_003Eu__2 = default(ConfiguredTaskAwaiter<string>);642 num = (_003C_003E1__state = -1);643 goto IL_01b5;644 }645 _003C_003E8__1 = new _003C_003Ec__DisplayClass7_0();646 _003C_003E8__1.uidContainer = uidContainer;647 if (string.IsNullOrEmpty(uidDomain) || string.IsNullOrEmpty(_003C_003E8__1.uidContainer))648 {649 result = true;650 }651 else652 {653 if (!directoryObjectEntityLogic.IsInternalProcess)654 {655 val = directoryObjectEntityLogic._cmParams.Table.GetForeignKeyAsync(directoryObjectEntityLogic._cmParams.Container, ct).ConfigureAwait(false).GetAwaiter();656 if (!val.IsCompleted)657 {658 num = (_003C_003E1__state = 0);659 _003C_003Eu__1 = val;660 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IMetaTableRelation>, _003C_CheckContainer_003Ed__7>(ref val, ref this);661 return;662 }663 goto IL_00e8;664 }665 result = true;666 }667 goto end_IL_000e;668 IL_00e8:669 IMetaTableRelation result2 = val.GetResult();670 _003C_003E8__1.fkContainer = result2;671 Query query = (from c in Query.From(_003C_003E8__1.fkContainer.ParentTableName)672 where c.Column(_003C_003E8__1.fkContainer.ChildColumnName) == _003C_003E8__1.uidContainer673 select c).Select(directoryObjectEntityLogic._cmParams.Domain);674 val2 = session.Source().GetSingleValueAsync<string>(query, ct).ConfigureAwait(false)675 .GetAwaiter();676 if (!val2.IsCompleted)677 {678 num = (_003C_003E1__state = 1);679 _003C_003Eu__2 = val2;680 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<string>, _003C_CheckContainer_003Ed__7>(ref val2, ref this);681 return;682 }683 goto IL_01b5;684 IL_01b5:685 string result3 = val2.GetResult();686 if (!string.Equals(uidDomain, result3))687 {688 throw new ViException(2088406, ExceptionRelevance.EndUser);689 }690 result = true;691 end_IL_000e:;692 }693 catch (System.Exception exception)694 {695 _003C_003E1__state = -2;696 _003C_003E8__1 = null;697 _003C_003Et__builder.SetException(exception);698 return;699 }700 _003C_003E1__state = -2;701 _003C_003E8__1 = null;702 _003C_003Et__builder.SetResult(result);703 }704705 [DebuggerHidden]706 private void SetStateMachine(IAsyncStateMachine stateMachine)707 {708 _003C_003Et__builder.SetStateMachine(stateMachine);709 }710 }711712 [StructLayout((LayoutKind)3)]713 [CompilerGenerated]714 private struct _003C_CheckDistinguishedName_003Ed__4 : IAsyncStateMachine715 {716 public int _003C_003E1__state;717718 public AsyncTaskMethodBuilder _003C_003Et__builder;719720 public ISession session;721722 public DirectoryObjectEntityLogic _003C_003E4__this;723724 public IEntity entity;725726 public CancellationToken ct;727728 private ConfiguredValueTaskAwaiter<string> _003C_003Eu__1;729730 private bool _003CbDnRoot_003E5__2;731732 private ConfiguredTaskAwaiter _003C_003Eu__2;733734 private void MoveNext()735 {736 //IL_00ed: Unknown result type (might be due to invalid IL or missing references)737 //IL_00f2: Unknown result type (might be due to invalid IL or missing references)738 //IL_00fa: Unknown result type (might be due to invalid IL or missing references)739 //IL_01b3: Unknown result type (might be due to invalid IL or missing references)740 //IL_01b8: Unknown result type (might be due to invalid IL or missing references)741 //IL_01c0: Unknown result type (might be due to invalid IL or missing references)742 //IL_0249: Unknown result type (might be due to invalid IL or missing references)743 //IL_024e: Unknown result type (might be due to invalid IL or missing references)744 //IL_0256: Unknown result type (might be due to invalid IL or missing references)745 //IL_0203: Unknown result type (might be due to invalid IL or missing references)746 //IL_020e: Unknown result type (might be due to invalid IL or missing references)747 //IL_0213: Unknown result type (might be due to invalid IL or missing references)748 //IL_0217: Unknown result type (might be due to invalid IL or missing references)749 //IL_021c: Unknown result type (might be due to invalid IL or missing references)750 //IL_0231: Unknown result type (might be due to invalid IL or missing references)751 //IL_0233: Unknown result type (might be due to invalid IL or missing references)752 //IL_0166: Unknown result type (might be due to invalid IL or missing references)753 //IL_0175: Unknown result type (might be due to invalid IL or missing references)754 //IL_017a: Unknown result type (might be due to invalid IL or missing references)755 //IL_017e: Unknown result type (might be due to invalid IL or missing references)756 //IL_0183: Unknown result type (might be due to invalid IL or missing references)757 //IL_00a0: Unknown result type (might be due to invalid IL or missing references)758 //IL_00af: Unknown result type (might be due to invalid IL or missing references)759 //IL_00b4: Unknown result type (might be due to invalid IL or missing references)760 //IL_00b8: Unknown result type (might be due to invalid IL or missing references)761 //IL_00bd: Unknown result type (might be due to invalid IL or missing references)762 //IL_0198: Unknown result type (might be due to invalid IL or missing references)763 //IL_019a: Unknown result type (might be due to invalid IL or missing references)764 //IL_00d2: Unknown result type (might be due to invalid IL or missing references)765 //IL_00d4: Unknown result type (might be due to invalid IL or missing references)766 int num = _003C_003E1__state;767 DirectoryObjectEntityLogic directoryObjectEntityLogic = _003C_003E4__this;768 try769 {770 ConfiguredValueTaskAwaiter<string> val2;771 ConfiguredTaskAwaiter val;772 bool flag;773 string result;774 DN dnResult;775 switch (num)776 {777 default:778 if (!DbVal.ConvertTo<bool>(session.Variables.Get("Projection")) && directoryObjectEntityLogic._cmParams.Table.Columns.Contains("DistinguishedName") && !string.IsNullOrEmpty(directoryObjectEntityLogic._cmParams.Container) && entity.Columns["DistinguishedName"].IsChanged)779 {780 val2 = entity.GetValueAsync<string>("DistinguishedName", ct).ConfigureAwait(false).GetAwaiter();781 if (!val2.IsCompleted)782 {783 num = (_003C_003E1__state = 0);784 _003C_003Eu__1 = val2;785 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<string>, _003C_CheckDistinguishedName_003Ed__4>(ref val2, ref this);786 return;787 }788 goto IL_0109;789 }790 goto end_IL_000e;791 case 0:792 val2 = _003C_003Eu__1;793 _003C_003Eu__1 = default(ConfiguredValueTaskAwaiter<string>);794 num = (_003C_003E1__state = -1);795 goto IL_0109;796 case 1:797 val2 = _003C_003Eu__1;798 _003C_003Eu__1 = default(ConfiguredValueTaskAwaiter<string>);799 num = (_003C_003E1__state = -1);800 goto IL_01cf;801 case 2:802 {803 val = _003C_003Eu__2;804 _003C_003Eu__2 = default(ConfiguredTaskAwaiter);805 num = (_003C_003E1__state = -1);806 break;807 }808 IL_01cf:809 flag = string.IsNullOrEmpty(val2.GetResult());810 if (_003CbDnRoot_003E5__2 ^ flag)811 {812 ConfiguredTaskAwaitable val3 = directoryObjectEntityLogic._cmParams.OnDNCheckFailedAsync.Invoke(session, entity, ct).ConfigureAwait(false);813 val = ((ConfiguredTaskAwaitable)(ref val3)).GetAwaiter();814 if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)815 {816 num = (_003C_003E1__state = 2);817 _003C_003Eu__2 = val;818 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003C_CheckDistinguishedName_003Ed__4>(ref val, ref this);819 return;820 }821 break;822 }823 goto end_IL_000e;824 IL_0109:825 result = val2.GetResult();826 if (!string.IsNullOrEmpty(result) && DN.TryParse(result, out dnResult))827 {828 DN domainDN = dnResult.GetDomainDN();829 if (domainDN != null)830 {831 _003CbDnRoot_003E5__2 = domainDN.Equals(dnResult.GetParentDN());832 val2 = entity.GetValueAsync<string>(directoryObjectEntityLogic._cmParams.Container, ct).ConfigureAwait(false).GetAwaiter();833 if (!val2.IsCompleted)834 {835 num = (_003C_003E1__state = 1);836 _003C_003Eu__1 = val2;837 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<string>, _003C_CheckDistinguishedName_003Ed__4>(ref val2, ref this);838 return;839 }840 goto IL_01cf;841 }842 }843 goto end_IL_000e;844 }845 ((ConfiguredTaskAwaiter)(ref val)).GetResult();846 end_IL_000e:;847 }848 catch (System.Exception exception)849 {850 _003C_003E1__state = -2;851 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);852 return;853 }854 _003C_003E1__state = -2;855 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();856 }857858 [DebuggerHidden]859 private void SetStateMachine(IAsyncStateMachine stateMachine)860 {861 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);862 }863 }864865 [StructLayout((LayoutKind)3)]866 [CompilerGenerated]867 private struct _003C_CheckParent_003Ed__5 : IAsyncStateMachine868 {869 public int _003C_003E1__state;870871 public AsyncTaskMethodBuilder<bool> _003C_003Et__builder;872873 public string uidNewParent;874875 public IEntity entity;876877 public DirectoryObjectEntityLogic _003C_003E4__this;878879 public CancellationToken ct;880881 private _003C_003Ec__DisplayClass5_0 _003C_003E8__1;882883 public ISession session;884885 private string _003CuidDomain_003E5__2;886887 private ConfiguredTaskAwaiter<IMetaTableRelation> _003C_003Eu__1;888889 private ConfiguredTaskAwaiter<string> _003C_003Eu__2;890891 private void MoveNext()892 {893 //IL_00ed: Unknown result type (might be due to invalid IL or missing references)894 //IL_00f2: Unknown result type (might be due to invalid IL or missing references)895 //IL_00fa: Unknown result type (might be due to invalid IL or missing references)896 //IL_0171: Unknown result type (might be due to invalid IL or missing references)897 //IL_017c: Unknown result type (might be due to invalid IL or missing references)898 //IL_0181: Unknown result type (might be due to invalid IL or missing references)899 //IL_0185: Unknown result type (might be due to invalid IL or missing references)900 //IL_018a: Unknown result type (might be due to invalid IL or missing references)901 //IL_01ba: Unknown result type (might be due to invalid IL or missing references)902 //IL_01bf: Unknown result type (might be due to invalid IL or missing references)903 //IL_01c7: Unknown result type (might be due to invalid IL or missing references)904 //IL_019f: Unknown result type (might be due to invalid IL or missing references)905 //IL_01a1: Unknown result type (might be due to invalid IL or missing references)906 //IL_00a4: Unknown result type (might be due to invalid IL or missing references)907 //IL_00af: Unknown result type (might be due to invalid IL or missing references)908 //IL_00b4: Unknown result type (might be due to invalid IL or missing references)909 //IL_00b8: Unknown result type (might be due to invalid IL or missing references)910 //IL_00bd: Unknown result type (might be due to invalid IL or missing references)911 //IL_00d2: Unknown result type (might be due to invalid IL or missing references)912 //IL_00d4: Unknown result type (might be due to invalid IL or missing references)913 int num = _003C_003E1__state;914 DirectoryObjectEntityLogic directoryObjectEntityLogic = _003C_003E4__this;915 bool result;916 try917 {918 ConfiguredTaskAwaiter<IMetaTableRelation> val;919 if (num == 0)920 {921 val = _003C_003Eu__1;922 _003C_003Eu__1 = default(ConfiguredTaskAwaiter<IMetaTableRelation>);923 num = (_003C_003E1__state = -1);924 goto IL_0109;925 }926 ConfiguredTaskAwaiter<string> val2;927 if (num == 1)928 {929 val2 = _003C_003Eu__2;930 _003C_003Eu__2 = default(ConfiguredTaskAwaiter<string>);931 num = (_003C_003E1__state = -1);932 goto IL_01d6;933 }934 _003C_003E8__1 = new _003C_003Ec__DisplayClass5_0();935 _003C_003E8__1.uidNewParent = uidNewParent;936 _003CuidDomain_003E5__2 = entity.GetValue(directoryObjectEntityLogic._cmParams.Domain);937 if (string.IsNullOrEmpty(_003CuidDomain_003E5__2) || string.IsNullOrEmpty(_003C_003E8__1.uidNewParent))938 {939 result = true;940 }941 else942 {943 if (!directoryObjectEntityLogic.IsInternalProcess)944 {945 val = directoryObjectEntityLogic._cmParams.Table.GetForeignKeyAsync(directoryObjectEntityLogic._cmParams.ParentContainer, ct).ConfigureAwait(false).GetAwaiter();946 if (!val.IsCompleted)947 {948 num = (_003C_003E1__state = 0);949 _003C_003Eu__1 = val;950 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IMetaTableRelation>, _003C_CheckParent_003Ed__5>(ref val, ref this);951 return;952 }953 goto IL_0109;954 }955 result = true;956 }957 goto end_IL_000e;958 IL_0109:959 IMetaTableRelation result2 = val.GetResult();960 _003C_003E8__1.fkContainer = result2;961 Query query = (from c in Query.From(_003C_003E8__1.fkContainer.ParentTableName)962 where c.Column(_003C_003E8__1.fkContainer.ParentColumnName) == _003C_003E8__1.uidNewParent963 select c).Select(directoryObjectEntityLogic._cmParams.Domain);964 val2 = session.Source().GetSingleValueAsync<string>(query, ct).ConfigureAwait(false)965 .GetAwaiter();966 if (!val2.IsCompleted)967 {968 num = (_003C_003E1__state = 1);969 _003C_003Eu__2 = val2;970 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<string>, _003C_CheckParent_003Ed__5>(ref val2, ref this);971 return;972 }973 goto IL_01d6;974 IL_01d6:975 string result3 = val2.GetResult();976 if (!string.Equals(_003CuidDomain_003E5__2, result3))977 {978 throw new ViException(2088097, ExceptionRelevance.EndUser);979 }980 result = true;981 end_IL_000e:;982 }983 catch (System.Exception exception)984 {985 _003C_003E1__state = -2;986 _003C_003E8__1 = null;987 _003CuidDomain_003E5__2 = null;988 _003C_003Et__builder.SetException(exception);989 return;990 }991 _003C_003E1__state = -2;992 _003C_003E8__1 = null;993 _003CuidDomain_003E5__2 = null;994 _003C_003Et__builder.SetResult(result);995 }996997 [DebuggerHidden]998 private void SetStateMachine(IAsyncStateMachine stateMachine)999 {1000 _003C_003Et__builder.SetStateMachine(stateMachine);1001 }1002 }10031004 [StructLayout((LayoutKind)3)]1005 [CompilerGenerated]1006 private struct _003C_CheckStructuralObjectClass_003Ed__3 : IAsyncStateMachine1007 {1008 public int _003C_003E1__state;10091010 public AsyncTaskMethodBuilder _003C_003Et__builder;10111012 public IEntity entity;10131014 public DirectoryObjectEntityLogic _003C_003E4__this;10151016 public IEntityWalker walker;10171018 public CancellationToken ct;10191020 public IMetaTable mTable;10211022 private ConfiguredValueTaskAwaiter<string> _003C_003Eu__1;10231024 private void MoveNext()1025 {1026 //IL_00cc: Unknown result type (might be due to invalid IL or missing references)1027 //IL_00d1: Unknown result type (might be due to invalid IL or missing references)1028 //IL_00d9: Unknown result type (might be due to invalid IL or missing references)1029 //IL_007f: Unknown result type (might be due to invalid IL or missing references)1030 //IL_008e: Unknown result type (might be due to invalid IL or missing references)1031 //IL_0093: Unknown result type (might be due to invalid IL or missing references)1032 //IL_0097: Unknown result type (might be due to invalid IL or missing references)1033 //IL_009c: Unknown result type (might be due to invalid IL or missing references)1034 //IL_00b1: Unknown result type (might be due to invalid IL or missing references)1035 //IL_00b3: Unknown result type (might be due to invalid IL or missing references)1036 int num = _003C_003E1__state;1037 DirectoryObjectEntityLogic directoryObjectEntityLogic = _003C_003E4__this;1038 try1039 {1040 ConfiguredValueTaskAwaiter<string> val;1041 if (num == 0)1042 {1043 val = _003C_003Eu__1;1044 _003C_003Eu__1 = default(ConfiguredValueTaskAwaiter<string>);1045 num = (_003C_003E1__state = -1);1046 goto IL_00e8;1047 }1048 if (entity.Columns.ChangedAny("StructuralObjectClass", "ObjectClass"))1049 {1050 if (!string.IsNullOrEmpty(directoryObjectEntityLogic._cmParams.SubType))1051 {1052 string definition = $"FK({directoryObjectEntityLogic._cmParams.Domain}).{directoryObjectEntityLogic._cmParams.SubType}";1053 val = walker.GetValueAsync<string>(definition, ct).ConfigureAwait(false).GetAwaiter();1054 if (!val.IsCompleted)1055 {1056 num = (_003C_003E1__state = 0);1057 _003C_003Eu__1 = val;1058 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<string>, _003C_CheckStructuralObjectClass_003Ed__3>(ref val, ref this);1059 return;1060 }1061 goto IL_00e8;1062 }1063 goto IL_0100;1064 }1065 goto end_IL_000e;1066 IL_0100:1067 MultiValueProperty multiValueProperty = new MultiValueProperty(entity.GetValue<string>("ObjectClass"));1068 string value = entity.GetValue<string>("StructuralObjectClass");1069 if (!multiValueProperty.Contains(value))1070 {1071 throw new ViException(2088512, ExceptionRelevance.EndUser, mTable.Columns["StructuralObjectClass"].Display, mTable.Columns["ObjectClass"].Display, value);1072 }1073 goto end_IL_000e;1074 IL_00e8:1075 if (!string.Equals(val.GetResult(), "LDP-c15f53d38c5540b3a9dde2d37461949d"))1076 {1077 goto IL_0100;1078 }1079 end_IL_000e:;1080 }1081 catch (System.Exception exception)1082 {1083 _003C_003E1__state = -2;1084 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);1085 return;1086 }1087 _003C_003E1__state = -2;1088 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();1089 }10901091 [DebuggerHidden]1092 private void SetStateMachine(IAsyncStateMachine stateMachine)1093 {1094 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);1095 }1096 }10971098 private readonly DirectoryObjectEntityLogicParameter _cmParams;10991100 public DirectoryObjectEntityLogic(EntityLogicConstructionParameters cParams, DirectoryObjectEntityLogicParameter cmParams)1101 {1102 _cmParams = cmParams;1103 _cmParams.Table = cParams.Table;1104 _cmParams.PrimaryKey = cParams.Table.PrimaryKeyColumns[0].Columnname;1105 Event("Move").CustomGenerated();1106 RegisterExpensive("_NamespaceManagedBy").DependsOn(cmParams.Domain).As<NameSpaceManagedBy>((Func<ISession, IEntity, IEntityWalker, CancellationToken, System.Threading.Tasks.Task<NameSpaceManagedBy>>)([AsyncStateMachine(typeof(_003C_003Ec__DisplayClass1_0._003C_003C_002Dctor_003Eb__0_003Ed))] async (ISession s, IEntity e, IEntityWalker w, CancellationToken ct) => (!s.IsFullSync()) ? (await TSBHelper.NamespaceManagedBy(w, "FK(" + cmParams.Domain + ").NamespaceManagedBy", ct).ConfigureAwait(false)) : NameSpaceManagedBy.Initial));1107 using (base.Section.From("SPECIAL(IsFullSync)", "_NamespaceManagedBy").As<bool, NameSpaceManagedBy>((Func<bool, NameSpaceManagedBy, bool>)((bool bFS, NameSpaceManagedBy m) => !bFS && m == NameSpaceManagedBy.VISYNC)))1108 {1109 MinLen(cmParams.Domain).Default(1);1110 if (cParams.Table.Columns.Contains("ObjectClass"))1111 {1112 Check("ObjectClass").As<string>(ObjectClass_CheckEmpyValues);1113 }1114 if (cParams.Table.Columns.Contains("StructuralObjectClass"))1115 {1116 CanEdit("StructuralObjectClass").From("[IsLoaded]").As<bool>((Func<bool, bool>)((bool isLoaded) => !isLoaded));1117 }1118 CanEdit(cmParams.Domain).From("[IsLoaded]", "SPECIAL(IsFullSync)", "SPECIAL(IsInteractive)").As<bool, bool, bool>((Func<bool, bool, bool, bool>)((bool isLoaded, bool isFullSync, bool isInteractive) => !isLoaded || isFullSync || !isInteractive));1119 if (!string.IsNullOrEmpty(cmParams.ParentContainer))1120 {1121 Value(cmParams.Domain).From("FK(" + cmParams.ParentContainer + ")." + cmParams.Domain).As<string, TryResult<string>>((string uidDomain) => TryResult.FromResult(!string.IsNullOrEmpty(uidDomain), uidDomain));1122 PreventLoops(cmParams.ParentContainer);1123 RegisterExtendedMethod("Move").As<string, string>((Func<ISession, IEntity, string, CancellationToken, System.Threading.Tasks.Task<string>>)MoveContainer).OnSaving(Move_OnSaving).Visible()1124 .From("[IsLoaded]")1125 .As<bool>((Func<bool, bool>)((bool bLoaded) => bLoaded));1126 }1127 else if (!string.IsNullOrEmpty(cmParams.Container))1128 {1129 Value(cmParams.Domain).From("FK(" + cmParams.Container + ")." + cmParams.Domain).As<string, TryResult<string>>((string uidDomain) => TryResult.FromResult(!string.IsNullOrEmpty(uidDomain), uidDomain));1130 RegisterExtendedMethod("Move").As<string, string>((Func<ISession, IEntity, string, CancellationToken, System.Threading.Tasks.Task<string>>)MoveObject).OnSaving(Move_OnSaving).Visible()1131 .From("[IsLoaded]")1132 .As<bool>((Func<bool, bool>)((bool bLoaded) => bLoaded));1133 }1134 }1135 }11361137 [AsyncStateMachine(typeof(_003COnSavingAsync_003Ed__2))]1138 public override async System.Threading.Tasks.Task<Diff> OnSavingAsync(IEntity entity, LogicReadWriteParameters parameters, CancellationToken ct)1139 {1140 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1141 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1142 //IL_0026: Unknown result type (might be due to invalid IL or missing references)1143 //IL_0027: Unknown result type (might be due to invalid IL or missing references)1144 if (!parameters.Session.IsFullSync())1145 {1146 await _CheckDistinguishedName(parameters.Session, entity, ct).ConfigureAwait(false);1147 if (!string.IsNullOrEmpty(_cmParams.ParentContainer))1148 {1149 await _CheckParent(parameters.Session, entity, entity.GetValue<string>(_cmParams.ParentContainer), ct).ConfigureAwait(false);1150 }1151 else if (!string.IsNullOrEmpty(_cmParams.Container))1152 {1153 await _CheckContainer(parameters.Session, entity, entity.GetValue<string>(_cmParams.Container), ct).ConfigureAwait(false);1154 }1155 if (!entity.IsDeleted() && parameters.Table.Columns.Contains("StructuralObjectClass") && parameters.Table.Columns.Contains("ObjectClass"))1156 {1157 await _CheckStructuralObjectClass(parameters.Table, entity, parameters.CreateWalker(entity), ct).ConfigureAwait(false);1158 }1159 }1160 return await base.OnSavingAsync(entity, parameters, ct).ConfigureAwait(false);1161 }11621163 [AsyncStateMachine(typeof(_003C_CheckStructuralObjectClass_003Ed__3))]1164 private System.Threading.Tasks.Task _CheckStructuralObjectClass(IMetaTable mTable, IEntity entity, IEntityWalker walker, CancellationToken ct)1165 {1166 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1167 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1168 //IL_002e: Unknown result type (might be due to invalid IL or missing references)1169 //IL_0030: Unknown result type (might be due to invalid IL or missing references)1170 _003C_CheckStructuralObjectClass_003Ed__3 _003C_CheckStructuralObjectClass_003Ed__ = default(_003C_CheckStructuralObjectClass_003Ed__3);1171 _003C_CheckStructuralObjectClass_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();1172 _003C_CheckStructuralObjectClass_003Ed__._003C_003E4__this = this;1173 _003C_CheckStructuralObjectClass_003Ed__.mTable = mTable;1174 _003C_CheckStructuralObjectClass_003Ed__.entity = entity;1175 _003C_CheckStructuralObjectClass_003Ed__.walker = walker;1176 _003C_CheckStructuralObjectClass_003Ed__.ct = ct;1177 _003C_CheckStructuralObjectClass_003Ed__._003C_003E1__state = -1;1178 ((AsyncTaskMethodBuilder)(ref _003C_CheckStructuralObjectClass_003Ed__._003C_003Et__builder)).Start<_003C_CheckStructuralObjectClass_003Ed__3>(ref _003C_CheckStructuralObjectClass_003Ed__);1179 return ((AsyncTaskMethodBuilder)(ref _003C_CheckStructuralObjectClass_003Ed__._003C_003Et__builder)).Task;1180 }11811182 [AsyncStateMachine(typeof(_003C_CheckDistinguishedName_003Ed__4))]1183 private System.Threading.Tasks.Task _CheckDistinguishedName(ISession session, IEntity entity, CancellationToken ct)1184 {1185 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1186 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1187 //IL_0026: Unknown result type (might be due to invalid IL or missing references)1188 //IL_0027: Unknown result type (might be due to invalid IL or missing references)1189 _003C_CheckDistinguishedName_003Ed__4 _003C_CheckDistinguishedName_003Ed__ = default(_003C_CheckDistinguishedName_003Ed__4);1190 _003C_CheckDistinguishedName_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();1191 _003C_CheckDistinguishedName_003Ed__._003C_003E4__this = this;1192 _003C_CheckDistinguishedName_003Ed__.session = session;1193 _003C_CheckDistinguishedName_003Ed__.entity = entity;1194 _003C_CheckDistinguishedName_003Ed__.ct = ct;1195 _003C_CheckDistinguishedName_003Ed__._003C_003E1__state = -1;1196 ((AsyncTaskMethodBuilder)(ref _003C_CheckDistinguishedName_003Ed__._003C_003Et__builder)).Start<_003C_CheckDistinguishedName_003Ed__4>(ref _003C_CheckDistinguishedName_003Ed__);1197 return ((AsyncTaskMethodBuilder)(ref _003C_CheckDistinguishedName_003Ed__._003C_003Et__builder)).Task;1198 }11991200 [AsyncStateMachine(typeof(_003C_CheckParent_003Ed__5))]1201 private async System.Threading.Tasks.Task<bool> _CheckParent(ISession session, IEntity entity, string uidNewParent, CancellationToken ct)1202 {1203 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1204 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1205 //IL_002e: Unknown result type (might be due to invalid IL or missing references)1206 //IL_0030: Unknown result type (might be due to invalid IL or missing references)1207 string uidDomain = entity.GetValue(_cmParams.Domain);1208 if (string.IsNullOrEmpty(uidDomain) || string.IsNullOrEmpty(uidNewParent))1209 {1210 return true;1211 }1212 if (base.IsInternalProcess)1213 {1214 return true;1215 }1216 IMetaTableRelation fkContainer = await _cmParams.Table.GetForeignKeyAsync(_cmParams.ParentContainer, ct).ConfigureAwait(false);1217 Query query = (from c in Query.From(fkContainer.ParentTableName)1218 where c.Column(fkContainer.ParentColumnName) == uidNewParent1219 select c).Select(_cmParams.Domain);1220 if (!string.Equals(uidDomain, await session.Source().GetSingleValueAsync<string>(query, ct).ConfigureAwait(false)))1221 {1222 throw new ViException(2088097, ExceptionRelevance.EndUser);1223 }1224 return true;1225 }12261227 [AsyncStateMachine(typeof(_003C_CheckContainer_003Ed__6))]1228 protected async System.Threading.Tasks.Task<bool> _CheckContainer(ISession session, IEntity entity, string uidContainer, CancellationToken ct)1229 {1230 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1231 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1232 //IL_002e: Unknown result type (might be due to invalid IL or missing references)1233 //IL_0030: Unknown result type (might be due to invalid IL or missing references)1234 string uidDomain = entity.GetValue(_cmParams.Domain);1235 return await _CheckContainer(session, uidDomain, uidContainer, ct).ConfigureAwait(false);1236 }12371238 [AsyncStateMachine(typeof(_003C_CheckContainer_003Ed__7))]1239 protected async System.Threading.Tasks.Task<bool> _CheckContainer(ISession session, string uidDomain, string uidContainer, CancellationToken ct)1240 {1241 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1242 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1243 //IL_002e: Unknown result type (might be due to invalid IL or missing references)1244 //IL_0030: Unknown result type (might be due to invalid IL or missing references)1245 if (string.IsNullOrEmpty(uidDomain) || string.IsNullOrEmpty(uidContainer))1246 {1247 return true;1248 }1249 if (base.IsInternalProcess)1250 {1251 return true;1252 }1253 IMetaTableRelation fkContainer = await _cmParams.Table.GetForeignKeyAsync(_cmParams.Container, ct).ConfigureAwait(false);1254 Query query = (from c in Query.From(fkContainer.ParentTableName)1255 where c.Column(fkContainer.ChildColumnName) == uidContainer1256 select c).Select(_cmParams.Domain);1257 if (!string.Equals(uidDomain, await session.Source().GetSingleValueAsync<string>(query, ct).ConfigureAwait(false)))1258 {1259 throw new ViException(2088406, ExceptionRelevance.EndUser);1260 }1261 return true;1262 }12631264 [AsyncStateMachine(typeof(_003CMoveContainer_003Ed__8))]1265 protected virtual async System.Threading.Tasks.Task<string> MoveContainer(ISession session, IEntity entity, string uidNewParent, CancellationToken ct)1266 {1267 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1268 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1269 //IL_002e: Unknown result type (might be due to invalid IL or missing references)1270 //IL_0030: Unknown result type (might be due to invalid IL or missing references)1271 if (!string.IsNullOrEmpty(uidNewParent))1272 {1273 await _CheckParent(session, entity, uidNewParent, ct).ConfigureAwait(false);1274 }1275 return uidNewParent;1276 }12771278 [AsyncStateMachine(typeof(_003CMoveObject_003Ed__9))]1279 protected virtual async System.Threading.Tasks.Task<string> MoveObject(ISession session, IEntity entity, string uidNewContainer, CancellationToken ct)1280 {1281 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1282 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1283 //IL_002e: Unknown result type (might be due to invalid IL or missing references)1284 //IL_0030: Unknown result type (might be due to invalid IL or missing references)1285 if (!string.IsNullOrEmpty(uidNewContainer))1286 {1287 await _CheckContainer(session, entity, uidNewContainer, ct).ConfigureAwait(false);1288 }1289 return uidNewContainer;1290 }12911292 [AsyncStateMachine(typeof(_003CMove_OnSaving_003Ed__10))]1293 private System.Threading.Tasks.Task Move_OnSaving(IEntity entity, LogicReadWriteParameters parameter, string uidNewParent, CancellationToken ct)1294 {1295 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1296 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1297 //IL_002e: Unknown result type (might be due to invalid IL or missing references)1298 //IL_0030: Unknown result type (might be due to invalid IL or missing references)1299 _003CMove_OnSaving_003Ed__10 _003CMove_OnSaving_003Ed__ = default(_003CMove_OnSaving_003Ed__10);1300 _003CMove_OnSaving_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();1301 _003CMove_OnSaving_003Ed__._003C_003E4__this = this;1302 _003CMove_OnSaving_003Ed__.entity = entity;1303 _003CMove_OnSaving_003Ed__.parameter = parameter;1304 _003CMove_OnSaving_003Ed__.uidNewParent = uidNewParent;1305 _003CMove_OnSaving_003Ed__.ct = ct;1306 _003CMove_OnSaving_003Ed__._003C_003E1__state = -1;1307 ((AsyncTaskMethodBuilder)(ref _003CMove_OnSaving_003Ed__._003C_003Et__builder)).Start<_003CMove_OnSaving_003Ed__10>(ref _003CMove_OnSaving_003Ed__);1308 return ((AsyncTaskMethodBuilder)(ref _003CMove_OnSaving_003Ed__._003C_003Et__builder)).Task;1309 }13101311 private bool ObjectClass_CheckEmpyValues(string strObjectClass)1312 {1313 if (Enumerable.Any<string>((System.Collections.Generic.IEnumerable<string>)new MultiValueProperty(strObjectClass), (Func<string, bool>)string.IsNullOrWhiteSpace))1314 {1315 throw new ViException(2088508, ExceptionRelevance.EndUser);1316 }1317 return true;1318 }1319}1320