ADS.Customizer/ADS.Customizer/ADSAccount.cs
Decompiler Source FileADS.Customizer.ADSAccountDecompiled 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 1311
- CustomGenerated event: OverLimit at line 1286
Typed Edges
- No typed edges extracted for this source.
References
- No direct source references extracted.
Referenced By
- No direct source references extracted.
C# source-derived context
Generated by pattern extraction from the decompiled C# source and decompile index. This is factual source evidence, not inferred behavior.
reads entity values references DB/Dialog objects
Summary: classes ADSAccount, MP, _003C_003Ec__DisplayClass10_0, _003C_003Ec__DisplayClass11_0; methods _003CRemoveMemberShips_003Eb__0, _003CUpdatePrimaryGroup_003Eb__0, _003CCheckMove_003Eb__0, MoveNext, SetStateMachine, FormatMVPValues; references ADSAccount, ADSAccountInADSGroup, ADSContainer, ADSDomain, ADSGroup, Person; markers reads entity values, references DB/Dialog objects
Classes
ADSAccount MP _003C_003Ec__DisplayClass10_0 _003C_003Ec__DisplayClass11_0 _003C_003Ec__DisplayClass9_0Methods
DB/Dialog object references
OIM key/entity markers
UID_ADSAccount UID_ADSDomain UID_ADSGroupPrimary UID_ADSGroup UID_ADSContainer XObjectKey UID_ProfileServer UID_HomeServerAPI/entity calls
GetValue ExistsAsync TryResult SqlFormatter GetValue Source Database GetObjectKey From IsDeleted Config AddPreCommitHook Encryption IsFullSyncRegistrations / handlers
None extracted.
Complete Source
1using System;2using System.Collections;3using System.Collections.Generic;4using System.Diagnostics;5using System.Linq;6using System.Runtime.CompilerServices;7using System.Runtime.InteropServices;8using System.Security;9using System.Threading;10using System.Threading.Tasks;11using TSB.Customizer;12using VI.Base;13using VI.DB;14using VI.DB.DataAccess;15using VI.DB.Entities;1617namespace ADS.Customizer;1819public class ADSAccount : DirectoryObjectEntityLogic20{21 private class MP22 {23 public string? UidDomain;2425 public string? UidContainer;26 }2728 [CompilerGenerated]29 private sealed class _003C_003Ec__DisplayClass10_030 {31 public string uidAdsAccount;3233 internal ExpressionClause _003CRemoveMemberShips_003Eb__0(IExpressionContext c)34 {35 return c.Column("UID_ADSAccount") == uidAdsAccount && c.Column("XOrigin") == 1;36 }37 }3839 [CompilerGenerated]40 private sealed class _003C_003Ec__DisplayClass11_041 {42 public string uidAdsDomain;4344 internal ExpressionClause _003CUpdatePrimaryGroup_003Eb__0(IExpressionContext c)45 {46 return c.Column("UID_ADSDomain") == uidAdsDomain && c.Column("PrimaryGroupToken") == "513";47 }48 }4950 [CompilerGenerated]51 private sealed class _003C_003Ec__DisplayClass9_052 {53 public string uidAdsAccount;5455 internal ExpressionClause _003CCheckMove_003Eb__0(IExpressionContext c)56 {57 return c.Column("UID_ADSAccount") == uidAdsAccount && c.Column("XOrigin") > 1;58 }59 }6061 [StructLayout((LayoutKind)3)]62 [CompilerGenerated]63 private struct _003CCheckADSPrimaryGroup_003Ed__6 : IAsyncStateMachine64 {65 public int _003C_003E1__state;6667 public AsyncTaskMethodBuilder<bool> _003C_003Et__builder;6869 public ISession session;7071 public ADSAccount _003C_003E4__this;7273 public string uidAdsGroupPrimary;7475 public IEntity entity;7677 public CancellationToken ct;7879 public string uidAdsDomain;8081 private ConfiguredTaskAwaiter<bool> _003C_003Eu__1;8283 private void MoveNext()84 {85 //IL_011c: Unknown result type (might be due to invalid IL or missing references)86 //IL_0121: Unknown result type (might be due to invalid IL or missing references)87 //IL_0129: Unknown result type (might be due to invalid IL or missing references)88 //IL_0205: Unknown result type (might be due to invalid IL or missing references)89 //IL_020a: Unknown result type (might be due to invalid IL or missing references)90 //IL_0212: Unknown result type (might be due to invalid IL or missing references)91 //IL_00d3: Unknown result type (might be due to invalid IL or missing references)92 //IL_00de: Unknown result type (might be due to invalid IL or missing references)93 //IL_00e3: Unknown result type (might be due to invalid IL or missing references)94 //IL_00e7: Unknown result type (might be due to invalid IL or missing references)95 //IL_00ec: Unknown result type (might be due to invalid IL or missing references)96 //IL_01bf: Unknown result type (might be due to invalid IL or missing references)97 //IL_01ca: Unknown result type (might be due to invalid IL or missing references)98 //IL_01cf: Unknown result type (might be due to invalid IL or missing references)99 //IL_01d3: Unknown result type (might be due to invalid IL or missing references)100 //IL_01d8: Unknown result type (might be due to invalid IL or missing references)101 //IL_0101: Unknown result type (might be due to invalid IL or missing references)102 //IL_0103: Unknown result type (might be due to invalid IL or missing references)103 //IL_01ed: Unknown result type (might be due to invalid IL or missing references)104 //IL_01ef: Unknown result type (might be due to invalid IL or missing references)105 int num = _003C_003E1__state;106 ADSAccount aDSAccount = _003C_003E4__this;107 bool result;108 try109 {110 ConfiguredTaskAwaiter<bool> val;111 if (num == 0)112 {113 val = _003C_003Eu__1;114 _003C_003Eu__1 = default(ConfiguredTaskAwaiter<bool>);115 num = (_003C_003E1__state = -1);116 goto IL_0138;117 }118 if (num == 1)119 {120 val = _003C_003Eu__1;121 _003C_003Eu__1 = default(ConfiguredTaskAwaiter<bool>);122 num = (_003C_003E1__state = -1);123 goto IL_0221;124 }125 ISqlFormatter sqlFormatter = session.SqlFormatter();126 if (!aDSAccount.IsInternalProcess)127 {128 if (string.IsNullOrEmpty(uidAdsGroupPrimary))129 {130 if (!string.IsNullOrEmpty((string)entity.GetValue("UID_ADSGroupPrimary")))131 {132 throw new ViException(2105197, ExceptionRelevance.EndUser);133 }134 }135 else136 {137 if (entity.IsLoaded)138 {139 string whereclause = sqlFormatter.AndRelation(sqlFormatter.UidComparison("UID_ADSAccount", entity.GetValue<string>("UID_ADSAccount")), sqlFormatter.UidComparison("UID_ADSGroup", uidAdsGroupPrimary));140 val = session.Source().ExistsAsync("ADSAccountInADSGroup", whereclause, ct).ConfigureAwait(false)141 .GetAwaiter();142 if (!val.IsCompleted)143 {144 num = (_003C_003E1__state = 0);145 _003C_003Eu__1 = val;146 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<bool>, _003CCheckADSPrimaryGroup_003Ed__6>(ref val, ref this);147 return;148 }149 goto IL_0138;150 }151 if (!string.IsNullOrEmpty(uidAdsDomain))152 {153 string whereclause = sqlFormatter.AndRelation(sqlFormatter.UidComparison("UID_ADSDomain", uidAdsDomain), sqlFormatter.UidComparison("UID_ADSGroup", uidAdsGroupPrimary), sqlFormatter.Comparison("PrimaryGroupToken", "513", ValType.String));154 val = session.Source().ExistsAsync("ADSGroup", whereclause, ct).ConfigureAwait(false)155 .GetAwaiter();156 if (!val.IsCompleted)157 {158 num = (_003C_003E1__state = 1);159 _003C_003Eu__1 = val;160 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<bool>, _003CCheckADSPrimaryGroup_003Ed__6>(ref val, ref this);161 return;162 }163 goto IL_0221;164 }165 }166 goto IL_0244;167 }168 result = true;169 goto end_IL_000e;170 IL_0221:171 if (!val.GetResult())172 {173 throw new ViException(2105413, ExceptionRelevance.EndUser, "Domain Users");174 }175 goto IL_0244;176 IL_0244:177 result = true;178 goto end_IL_000e;179 IL_0138:180 if (!val.GetResult())181 {182 throw new ViException(2105198, ExceptionRelevance.EndUser);183 }184 goto IL_0244;185 end_IL_000e:;186 }187 catch (System.Exception exception)188 {189 _003C_003E1__state = -2;190 _003C_003Et__builder.SetException(exception);191 return;192 }193 _003C_003E1__state = -2;194 _003C_003Et__builder.SetResult(result);195 }196197 [DebuggerHidden]198 private void SetStateMachine(IAsyncStateMachine stateMachine)199 {200 _003C_003Et__builder.SetStateMachine(stateMachine);201 }202 }203204 [StructLayout((LayoutKind)3)]205 [CompilerGenerated]206 private struct _003CCheckMove_003Ed__9 : IAsyncStateMachine207 {208 public int _003C_003E1__state;209210 public AsyncTaskMethodBuilder _003C_003Et__builder;211212 public IEntity entity;213214 public ISession session;215216 public string uidNewDomain;217218 public CancellationToken ct;219220 public ADSAccount _003C_003E4__this;221222 public string uidNewContainer;223224 private _003C_003Ec__DisplayClass9_0 _003C_003E8__1;225226 private ConfiguredTaskAwaiter<object> _003C_003Eu__1;227228 private ConfiguredTaskAwaiter<bool> _003C_003Eu__2;229230 private ConfiguredTaskAwaiter<IEntityCollection> _003C_003Eu__3;231232 private void MoveNext()233 {234 //IL_0107: Unknown result type (might be due to invalid IL or missing references)235 //IL_010c: Unknown result type (might be due to invalid IL or missing references)236 //IL_0114: Unknown result type (might be due to invalid IL or missing references)237 //IL_01c3: Unknown result type (might be due to invalid IL or missing references)238 //IL_01c8: Unknown result type (might be due to invalid IL or missing references)239 //IL_01d0: Unknown result type (might be due to invalid IL or missing references)240 //IL_028a: Unknown result type (might be due to invalid IL or missing references)241 //IL_028f: Unknown result type (might be due to invalid IL or missing references)242 //IL_0297: Unknown result type (might be due to invalid IL or missing references)243 //IL_0241: Unknown result type (might be due to invalid IL or missing references)244 //IL_024c: Unknown result type (might be due to invalid IL or missing references)245 //IL_0251: Unknown result type (might be due to invalid IL or missing references)246 //IL_0255: Unknown result type (might be due to invalid IL or missing references)247 //IL_025a: Unknown result type (might be due to invalid IL or missing references)248 //IL_00be: Unknown result type (might be due to invalid IL or missing references)249 //IL_00c9: Unknown result type (might be due to invalid IL or missing references)250 //IL_00ce: Unknown result type (might be due to invalid IL or missing references)251 //IL_00d2: Unknown result type (might be due to invalid IL or missing references)252 //IL_00d7: Unknown result type (might be due to invalid IL or missing references)253 //IL_017a: Unknown result type (might be due to invalid IL or missing references)254 //IL_0185: Unknown result type (might be due to invalid IL or missing references)255 //IL_018a: Unknown result type (might be due to invalid IL or missing references)256 //IL_018e: Unknown result type (might be due to invalid IL or missing references)257 //IL_0193: Unknown result type (might be due to invalid IL or missing references)258 //IL_026f: Unknown result type (might be due to invalid IL or missing references)259 //IL_0271: Unknown result type (might be due to invalid IL or missing references)260 //IL_00ec: Unknown result type (might be due to invalid IL or missing references)261 //IL_00ee: Unknown result type (might be due to invalid IL or missing references)262 //IL_01a8: Unknown result type (might be due to invalid IL or missing references)263 //IL_01aa: Unknown result type (might be due to invalid IL or missing references)264 int num = _003C_003E1__state;265 ADSAccount aDSAccount = _003C_003E4__this;266 try267 {268 ConfiguredTaskAwaiter<object> val3;269 ConfiguredTaskAwaiter<bool> val2;270 ConfiguredTaskAwaiter<IEntityCollection> val;271 Query query;272 switch (num)273 {274 default:275 {276 _003C_003E8__1 = new _003C_003Ec__DisplayClass9_0();277 string value = entity.Columns["UID_ADSDomain"].GetValue<string>();278 if (!string.IsNullOrEmpty(value))279 {280 ISqlFormatter formatter = session.SqlFormatter();281 string systemIdentifier = session.Database().SystemIdentifier;282 global::_003C_003Ey__InlineArray2<object> buffer = default(global::_003C_003Ey__InlineArray2<object>);283 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray2<object>, object>(ref buffer, 0) = formatter.FormatUidValue(value);284 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray2<object>, object>(ref buffer, 1) = formatter.FormatUidValue(uidNewDomain);285 string sqlStatement = SqlStrings.Format(systemIdentifier, "ADSAccount_MoveDomain", global::_003CPrivateImplementationDetails_003E.InlineArrayAsReadOnlySpan<global::_003C_003Ey__InlineArray2<object>, object>(in buffer, 2));286 val3 = session.Resolve<IDbSession>().SqlExecuteScalarAsync(sqlStatement, ct).ConfigureAwait(false)287 .GetAwaiter();288 if (!val3.IsCompleted)289 {290 num = (_003C_003E1__state = 0);291 _003C_003Eu__1 = val3;292 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<object>, _003CCheckMove_003Ed__9>(ref val3, ref this);293 return;294 }295 goto IL_0123;296 }297 goto end_IL_000e;298 }299 case 0:300 val3 = _003C_003Eu__1;301 _003C_003Eu__1 = default(ConfiguredTaskAwaiter<object>);302 num = (_003C_003E1__state = -1);303 goto IL_0123;304 case 1:305 val2 = _003C_003Eu__2;306 _003C_003Eu__2 = default(ConfiguredTaskAwaiter<bool>);307 num = (_003C_003E1__state = -1);308 goto IL_01df;309 case 2:310 {311 val = _003C_003Eu__3;312 _003C_003Eu__3 = default(ConfiguredTaskAwaiter<IEntityCollection>);313 num = (_003C_003E1__state = -1);314 break;315 }316 IL_0123:317 if (!DbVal.ConvertTo<bool>(val3.GetResult()))318 {319 string objectDisplay = DbObjectKey.GetObjectKey("ADSDomain", uidNewDomain).GetObjectDisplay(session);320 throw new ViException(2105414, ExceptionRelevance.EndUser, objectDisplay);321 }322 val2 = aDSAccount._CheckContainer(session, uidNewDomain, uidNewContainer, ct).ConfigureAwait(false).GetAwaiter();323 if (!val2.IsCompleted)324 {325 num = (_003C_003E1__state = 1);326 _003C_003Eu__2 = val2;327 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<bool>, _003CCheckMove_003Ed__9>(ref val2, ref this);328 return;329 }330 goto IL_01df;331 IL_01df:332 val2.GetResult();333 _003C_003E8__1.uidAdsAccount = entity.Columns["UID_ADSAccount"].GetValue<string>();334 query = (from c in Query.From("ADSAccountInADSGroup")335 where c.Column("UID_ADSAccount") == _003C_003E8__1.uidAdsAccount && c.Column("XOrigin") > 1336 select c).SelectDisplays();337 val = session.Source().GetCollectionAsync(query, ct).ConfigureAwait(false)338 .GetAwaiter();339 if (!val.IsCompleted)340 {341 num = (_003C_003E1__state = 2);342 _003C_003Eu__3 = val;343 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntityCollection>, _003CCheckMove_003Ed__9>(ref val, ref this);344 return;345 }346 break;347 }348 IEntityCollection result = val.GetResult();349 if (((System.Collections.Generic.IReadOnlyCollection<IEntity>)result).Count > 0)350 {351 string text = string.Join(Environment.NewLine, Enumerable.Select<IEntity, string>((System.Collections.Generic.IEnumerable<IEntity>)result, (Func<IEntity, string>)((IEntity e) => e.Display)));352 throw new ViException(2105415, ExceptionRelevance.EndUser, text);353 }354 end_IL_000e:;355 }356 catch (System.Exception exception)357 {358 _003C_003E1__state = -2;359 _003C_003E8__1 = null;360 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);361 return;362 }363 _003C_003E1__state = -2;364 _003C_003E8__1 = null;365 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();366 }367368 [DebuggerHidden]369 private void SetStateMachine(IAsyncStateMachine stateMachine)370 {371 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);372 }373 }374375 [StructLayout((LayoutKind)3)]376 [CompilerGenerated]377 private struct _003CMoveDomain_003Ed__7 : IAsyncStateMachine378 {379 public int _003C_003E1__state;380381 public AsyncTaskMethodBuilder<MP> _003C_003Et__builder;382383 public string uidNewDomain;384385 public string uidNewContainer;386387 public ADSAccount _003C_003E4__this;388389 public ISession session;390391 public IEntity entity;392393 public CancellationToken ct;394395 private ConfiguredTaskAwaiter _003C_003Eu__1;396397 private void MoveNext()398 {399 //IL_00ac: Unknown result type (might be due to invalid IL or missing references)400 //IL_00b1: Unknown result type (might be due to invalid IL or missing references)401 //IL_00b8: Unknown result type (might be due to invalid IL or missing references)402 //IL_002b: Unknown result type (might be due to invalid IL or missing references)403 //IL_0068: Unknown result type (might be due to invalid IL or missing references)404 //IL_0073: Unknown result type (might be due to invalid IL or missing references)405 //IL_0078: Unknown result type (might be due to invalid IL or missing references)406 //IL_007c: Unknown result type (might be due to invalid IL or missing references)407 //IL_0081: Unknown result type (might be due to invalid IL or missing references)408 //IL_0048: Unknown result type (might be due to invalid IL or missing references)409 //IL_0095: Unknown result type (might be due to invalid IL or missing references)410 //IL_0096: Unknown result type (might be due to invalid IL or missing references)411 int num = _003C_003E1__state;412 ADSAccount aDSAccount = _003C_003E4__this;413 MP result;414 try415 {416 ConfiguredTaskAwaiter val2;417 if (num != 0)418 {419 if (string.IsNullOrWhiteSpace(uidNewDomain))420 {421 throw new ArgumentException("'uidNewDomain' cannot be null or whitespace.", "uidNewDomain");422 }423 if (string.IsNullOrWhiteSpace(uidNewContainer))424 {425 throw new ArgumentException("'uidNewContainer' cannot be null or whitespace.", "uidNewContainer");426 }427 ConfiguredTaskAwaitable val = aDSAccount.CheckMove(session, entity, uidNewDomain, uidNewContainer, ct).ConfigureAwait(false);428 val2 = ((ConfiguredTaskAwaitable)(ref val)).GetAwaiter();429 if (!((ConfiguredTaskAwaiter)(ref val2)).IsCompleted)430 {431 num = (_003C_003E1__state = 0);432 _003C_003Eu__1 = val2;433 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003CMoveDomain_003Ed__7>(ref val2, ref this);434 return;435 }436 }437 else438 {439 val2 = _003C_003Eu__1;440 _003C_003Eu__1 = default(ConfiguredTaskAwaiter);441 num = (_003C_003E1__state = -1);442 }443 ((ConfiguredTaskAwaiter)(ref val2)).GetResult();444 result = new MP445 {446 UidDomain = uidNewDomain,447 UidContainer = uidNewContainer448 };449 }450 catch (System.Exception exception)451 {452 _003C_003E1__state = -2;453 _003C_003Et__builder.SetException(exception);454 return;455 }456 _003C_003E1__state = -2;457 _003C_003Et__builder.SetResult(result);458 }459460 [DebuggerHidden]461 private void SetStateMachine(IAsyncStateMachine stateMachine)462 {463 _003C_003Et__builder.SetStateMachine(stateMachine);464 }465 }466467 [StructLayout((LayoutKind)3)]468 [CompilerGenerated]469 private struct _003CMoveDomain_OnSaving_003Ed__8 : IAsyncStateMachine470 {471 public int _003C_003E1__state;472473 public AsyncTaskMethodBuilder _003C_003Et__builder;474475 public ADSAccount _003C_003E4__this;476477 public IEntity entity;478479 public MP moveParameter;480481 public CancellationToken ct;482483 public LogicReadWriteParameters parameter;484485 private System.IDisposable _003C_003E7__wrap1;486487 private ConfiguredValueTaskAwaiter<ApplyResult> _003C_003Eu__1;488489 private ConfiguredTaskAwaiter _003C_003Eu__2;490491 private void MoveNext()492 {493 //IL_009d: Unknown result type (might be due to invalid IL or missing references)494 //IL_00a2: Unknown result type (might be due to invalid IL or missing references)495 //IL_00a9: Unknown result type (might be due to invalid IL or missing references)496 //IL_0126: Unknown result type (might be due to invalid IL or missing references)497 //IL_012b: Unknown result type (might be due to invalid IL or missing references)498 //IL_0133: Unknown result type (might be due to invalid IL or missing references)499 //IL_01a1: Unknown result type (might be due to invalid IL or missing references)500 //IL_01a6: Unknown result type (might be due to invalid IL or missing references)501 //IL_01ae: Unknown result type (might be due to invalid IL or missing references)502 //IL_0053: Unknown result type (might be due to invalid IL or missing references)503 //IL_0061: Unknown result type (might be due to invalid IL or missing references)504 //IL_0066: Unknown result type (might be due to invalid IL or missing references)505 //IL_006a: Unknown result type (might be due to invalid IL or missing references)506 //IL_006f: Unknown result type (might be due to invalid IL or missing references)507 //IL_00dd: Unknown result type (might be due to invalid IL or missing references)508 //IL_00e8: Unknown result type (might be due to invalid IL or missing references)509 //IL_00ed: Unknown result type (might be due to invalid IL or missing references)510 //IL_00f1: Unknown result type (might be due to invalid IL or missing references)511 //IL_00f6: Unknown result type (might be due to invalid IL or missing references)512 //IL_015b: Unknown result type (might be due to invalid IL or missing references)513 //IL_0166: Unknown result type (might be due to invalid IL or missing references)514 //IL_016b: Unknown result type (might be due to invalid IL or missing references)515 //IL_016f: Unknown result type (might be due to invalid IL or missing references)516 //IL_0174: Unknown result type (might be due to invalid IL or missing references)517 //IL_0083: Unknown result type (might be due to invalid IL or missing references)518 //IL_0084: Unknown result type (might be due to invalid IL or missing references)519 //IL_010b: Unknown result type (might be due to invalid IL or missing references)520 //IL_010d: Unknown result type (might be due to invalid IL or missing references)521 //IL_0189: Unknown result type (might be due to invalid IL or missing references)522 //IL_018b: Unknown result type (might be due to invalid IL or missing references)523 int num = _003C_003E1__state;524 ADSAccount aDSAccount = _003C_003E4__this;525 try526 {527 if ((uint)num > 2u)528 {529 _003C_003E7__wrap1 = aDSAccount.StartInternalProcess();530 }531 try532 {533 ConfiguredValueTaskAwaiter<ApplyResult> val2;534 ConfiguredTaskAwaiter val;535 ConfiguredTaskAwaitable val3;536 switch (num)537 {538 default:539 val2 = entity.Columns["UID_ADSContainer"].SetValueAsync(moveParameter.UidContainer, SetValueBehavior.Default, ct).ConfigureAwait(false).GetAwaiter();540 if (!val2.IsCompleted)541 {542 num = (_003C_003E1__state = 0);543 _003C_003Eu__1 = val2;544 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<ApplyResult>, _003CMoveDomain_OnSaving_003Ed__8>(ref val2, ref this);545 return;546 }547 goto IL_00b8;548 case 0:549 val2 = _003C_003Eu__1;550 _003C_003Eu__1 = default(ConfiguredValueTaskAwaiter<ApplyResult>);551 num = (_003C_003E1__state = -1);552 goto IL_00b8;553 case 1:554 val = _003C_003Eu__2;555 _003C_003Eu__2 = default(ConfiguredTaskAwaiter);556 num = (_003C_003E1__state = -1);557 goto IL_0142;558 case 2:559 {560 val = _003C_003Eu__2;561 _003C_003Eu__2 = default(ConfiguredTaskAwaiter);562 num = (_003C_003E1__state = -1);563 break;564 }565 IL_0142:566 ((ConfiguredTaskAwaiter)(ref val)).GetResult();567 val3 = UpdatePrimaryGroup(parameter.Session, entity, ct).ConfigureAwait(false);568 val = ((ConfiguredTaskAwaitable)(ref val3)).GetAwaiter();569 if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)570 {571 num = (_003C_003E1__state = 2);572 _003C_003Eu__2 = val;573 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003CMoveDomain_OnSaving_003Ed__8>(ref val, ref this);574 return;575 }576 break;577 IL_00b8:578 val2.GetResult();579 val3 = RemoveMemberShips(parameter.Session, parameter.UnitOfWork, entity, ct).ConfigureAwait(false);580 val = ((ConfiguredTaskAwaitable)(ref val3)).GetAwaiter();581 if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)582 {583 num = (_003C_003E1__state = 1);584 _003C_003Eu__2 = val;585 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003CMoveDomain_OnSaving_003Ed__8>(ref val, ref this);586 return;587 }588 goto IL_0142;589 }590 ((ConfiguredTaskAwaiter)(ref val)).GetResult();591 }592 finally593 {594 if (num < 0 && _003C_003E7__wrap1 != null)595 {596 _003C_003E7__wrap1.Dispose();597 }598 }599 _003C_003E7__wrap1 = null;600 }601 catch (System.Exception exception)602 {603 _003C_003E1__state = -2;604 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);605 return;606 }607 _003C_003E1__state = -2;608 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();609 }610611 [DebuggerHidden]612 private void SetStateMachine(IAsyncStateMachine stateMachine)613 {614 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);615 }616 }617618 [StructLayout((LayoutKind)3)]619 [CompilerGenerated]620 private struct _003COnSavedAsync_003Ed__13 : IAsyncStateMachine621 {622 public int _003C_003E1__state;623624 public AsyncTaskMethodBuilder _003C_003Et__builder;625626 public IEntity entity;627628 public LogicReadWriteParameters parameters;629630 public CancellationToken cancellationToken;631632 public ADSAccount _003C_003E4__this;633634 private ConfiguredTaskAwaiter<bool> _003C_003Eu__1;635636 private ConfiguredTaskAwaiter _003C_003Eu__2;637638 private void MoveNext()639 {640 //IL_006b: Unknown result type (might be due to invalid IL or missing references)641 //IL_0070: Unknown result type (might be due to invalid IL or missing references)642 //IL_0077: Unknown result type (might be due to invalid IL or missing references)643 //IL_009c: Unknown result type (might be due to invalid IL or missing references)644 //IL_00a7: Unknown result type (might be due to invalid IL or missing references)645 //IL_00ac: Unknown result type (might be due to invalid IL or missing references)646 //IL_00b0: Unknown result type (might be due to invalid IL or missing references)647 //IL_00b5: Unknown result type (might be due to invalid IL or missing references)648 //IL_00e2: Unknown result type (might be due to invalid IL or missing references)649 //IL_00e7: Unknown result type (might be due to invalid IL or missing references)650 //IL_00ef: Unknown result type (might be due to invalid IL or missing references)651 //IL_0025: Unknown result type (might be due to invalid IL or missing references)652 //IL_0030: Unknown result type (might be due to invalid IL or missing references)653 //IL_0035: Unknown result type (might be due to invalid IL or missing references)654 //IL_0038: Unknown result type (might be due to invalid IL or missing references)655 //IL_003d: Unknown result type (might be due to invalid IL or missing references)656 //IL_00ca: Unknown result type (might be due to invalid IL or missing references)657 //IL_00cc: Unknown result type (might be due to invalid IL or missing references)658 //IL_0051: Unknown result type (might be due to invalid IL or missing references)659 //IL_0052: Unknown result type (might be due to invalid IL or missing references)660 int num = _003C_003E1__state;661 ADSAccount aDSAccount = _003C_003E4__this;662 try663 {664 ConfiguredTaskAwaiter val;665 ConfiguredTaskAwaiter<bool> val2;666 if (num != 0)667 {668 if (num == 1)669 {670 val = _003C_003Eu__2;671 _003C_003Eu__2 = default(ConfiguredTaskAwaiter);672 num = (_003C_003E1__state = -1);673 goto IL_00fe;674 }675 val2 = ADSHelper.CheckObjectKeyManager(entity, parameters, cancellationToken).ConfigureAwait(false).GetAwaiter();676 if (!val2.IsCompleted)677 {678 num = (_003C_003E1__state = 0);679 _003C_003Eu__1 = val2;680 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<bool>, _003COnSavedAsync_003Ed__13>(ref val2, ref this);681 return;682 }683 }684 else685 {686 val2 = _003C_003Eu__1;687 _003C_003Eu__1 = default(ConfiguredTaskAwaiter<bool>);688 num = (_003C_003E1__state = -1);689 }690 val2.GetResult();691 ConfiguredTaskAwaitable val3 = ((StateBasedEntityLogic)aDSAccount).OnSavedAsync(entity, parameters, cancellationToken).ConfigureAwait(false);692 val = ((ConfiguredTaskAwaitable)(ref val3)).GetAwaiter();693 if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)694 {695 num = (_003C_003E1__state = 1);696 _003C_003Eu__2 = val;697 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnSavedAsync_003Ed__13>(ref val, ref this);698 return;699 }700 goto IL_00fe;701 IL_00fe:702 ((ConfiguredTaskAwaiter)(ref val)).GetResult();703 }704 catch (System.Exception exception)705 {706 _003C_003E1__state = -2;707 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);708 return;709 }710 _003C_003E1__state = -2;711 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();712 }713714 [DebuggerHidden]715 private void SetStateMachine(IAsyncStateMachine stateMachine)716 {717 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);718 }719 }720721 [StructLayout((LayoutKind)3)]722 [CompilerGenerated]723 private struct _003COnSavingAsync_003Ed__12 : IAsyncStateMachine724 {725 public int _003C_003E1__state;726727 public AsyncTaskMethodBuilder<Diff> _003C_003Et__builder;728729 public LogicReadWriteParameters parameters;730731 public IEntity entity;732733 public CancellationToken ct;734735 public ADSAccount _003C_003E4__this;736737 private ISession _003Csession_003E5__2;738739 private string _003CuidAdsDomain_003E5__3;740741 private ConfiguredTaskAwaiter<string> _003C_003Eu__1;742743 private ConfiguredTaskAwaiter _003C_003Eu__2;744745 private ConfiguredTaskAwaiter<bool> _003C_003Eu__3;746747 private ConfiguredTaskAwaiter<Diff> _003C_003Eu__4;748749 private void MoveNext()750 {751 //IL_00f4: Unknown result type (might be due to invalid IL or missing references)752 //IL_00f9: Unknown result type (might be due to invalid IL or missing references)753 //IL_0101: Unknown result type (might be due to invalid IL or missing references)754 //IL_0198: Unknown result type (might be due to invalid IL or missing references)755 //IL_019d: Unknown result type (might be due to invalid IL or missing references)756 //IL_01a5: Unknown result type (might be due to invalid IL or missing references)757 //IL_05bb: Unknown result type (might be due to invalid IL or missing references)758 //IL_05c0: Unknown result type (might be due to invalid IL or missing references)759 //IL_05c8: Unknown result type (might be due to invalid IL or missing references)760 //IL_0674: Unknown result type (might be due to invalid IL or missing references)761 //IL_0679: Unknown result type (might be due to invalid IL or missing references)762 //IL_0681: Unknown result type (might be due to invalid IL or missing references)763 //IL_06eb: Unknown result type (might be due to invalid IL or missing references)764 //IL_06f0: Unknown result type (might be due to invalid IL or missing references)765 //IL_06f8: Unknown result type (might be due to invalid IL or missing references)766 //IL_014f: Unknown result type (might be due to invalid IL or missing references)767 //IL_015a: Unknown result type (might be due to invalid IL or missing references)768 //IL_015f: Unknown result type (might be due to invalid IL or missing references)769 //IL_0163: Unknown result type (might be due to invalid IL or missing references)770 //IL_0168: Unknown result type (might be due to invalid IL or missing references)771 //IL_06a5: Unknown result type (might be due to invalid IL or missing references)772 //IL_06b0: Unknown result type (might be due to invalid IL or missing references)773 //IL_06b5: Unknown result type (might be due to invalid IL or missing references)774 //IL_06b9: Unknown result type (might be due to invalid IL or missing references)775 //IL_06be: Unknown result type (might be due to invalid IL or missing references)776 //IL_017d: Unknown result type (might be due to invalid IL or missing references)777 //IL_017f: Unknown result type (might be due to invalid IL or missing references)778 //IL_06d3: Unknown result type (might be due to invalid IL or missing references)779 //IL_06d5: Unknown result type (might be due to invalid IL or missing references)780 //IL_062b: Unknown result type (might be due to invalid IL or missing references)781 //IL_0636: Unknown result type (might be due to invalid IL or missing references)782 //IL_063b: Unknown result type (might be due to invalid IL or missing references)783 //IL_063f: Unknown result type (might be due to invalid IL or missing references)784 //IL_0644: Unknown result type (might be due to invalid IL or missing references)785 //IL_00ab: Unknown result type (might be due to invalid IL or missing references)786 //IL_00b6: Unknown result type (might be due to invalid IL or missing references)787 //IL_00bb: Unknown result type (might be due to invalid IL or missing references)788 //IL_00bf: Unknown result type (might be due to invalid IL or missing references)789 //IL_00c4: Unknown result type (might be due to invalid IL or missing references)790 //IL_0659: Unknown result type (might be due to invalid IL or missing references)791 //IL_065b: Unknown result type (might be due to invalid IL or missing references)792 //IL_00d9: Unknown result type (might be due to invalid IL or missing references)793 //IL_00db: Unknown result type (might be due to invalid IL or missing references)794 //IL_0572: Unknown result type (might be due to invalid IL or missing references)795 //IL_057d: Unknown result type (might be due to invalid IL or missing references)796 //IL_0582: Unknown result type (might be due to invalid IL or missing references)797 //IL_0586: Unknown result type (might be due to invalid IL or missing references)798 //IL_058b: Unknown result type (might be due to invalid IL or missing references)799 //IL_05a0: Unknown result type (might be due to invalid IL or missing references)800 //IL_05a2: Unknown result type (might be due to invalid IL or missing references)801 int num = _003C_003E1__state;802 ADSAccount aDSAccount = _003C_003E4__this;803 Diff result;804 try805 {806 ConfiguredTaskAwaiter<string> val4;807 ConfiguredTaskAwaiter val2;808 ConfiguredTaskAwaiter<bool> val3;809 ConfiguredTaskAwaiter<Diff> val;810 ConfiguredTaskAwaitable val5;811 switch (num)812 {813 default:814 _003Csession_003E5__2 = parameters.Session;815 _003CuidAdsDomain_003E5__3 = entity.GetValue<string>("UID_ADSDomain");816 ADSHelper.CheckIsProtectedFromAccidentalDel(_003Csession_003E5__2, entity);817 if (!_003Csession_003E5__2.IsFullSync() && !entity.IsDeleted() && !string.IsNullOrEmpty(_003CuidAdsDomain_003E5__3))818 {819 val4 = parameters.Session.Config().GetConfigParmAsync("TargetSystem\\ADS\\Accounts\\NotRequirePassword", ct).ConfigureAwait(false)820 .GetAwaiter();821 if (!val4.IsCompleted)822 {823 num = (_003C_003E1__state = 0);824 _003C_003Eu__1 = val4;825 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<string>, _003COnSavingAsync_003Ed__12>(ref val4, ref this);826 return;827 }828 goto IL_0110;829 }830 goto IL_05df;831 case 0:832 val4 = _003C_003Eu__1;833 _003C_003Eu__1 = default(ConfiguredTaskAwaiter<string>);834 num = (_003C_003E1__state = -1);835 goto IL_0110;836 case 1:837 val2 = _003C_003Eu__2;838 _003C_003Eu__2 = default(ConfiguredTaskAwaiter);839 num = (_003C_003E1__state = -1);840 goto IL_01b4;841 case 2:842 val3 = _003C_003Eu__3;843 _003C_003Eu__3 = default(ConfiguredTaskAwaiter<bool>);844 num = (_003C_003E1__state = -1);845 goto IL_05d7;846 case 3:847 val2 = _003C_003Eu__2;848 _003C_003Eu__2 = default(ConfiguredTaskAwaiter);849 num = (_003C_003E1__state = -1);850 goto IL_0690;851 case 4:852 {853 val = _003C_003Eu__4;854 _003C_003Eu__4 = default(ConfiguredTaskAwaiter<Diff>);855 num = (_003C_003E1__state = -1);856 break;857 }858 IL_01b4:859 ((ConfiguredTaskAwaiter)(ref val2)).GetResult();860 goto IL_01bb;861 IL_01bb:862 TSBHelper.RemoveEmptyValues(entity.Columns["OtherFax"]);863 TSBHelper.RemoveEmptyValues(entity.Columns["OtherHomePhone"]);864 TSBHelper.RemoveEmptyValues(entity.Columns["OtherIPPhone"]);865 TSBHelper.RemoveEmptyValues(entity.Columns["OtherMailbox"]);866 TSBHelper.RemoveEmptyValues(entity.Columns["OtherMobile"]);867 TSBHelper.RemoveEmptyValues(entity.Columns["OtherPager"]);868 TSBHelper.RemoveEmptyValues(entity.Columns["OtherTelephoneNumber"]);869 TSBHelper.RemoveEmptyValues(entity.Columns["OtherWWW"]);870 if (entity.Columns.ChangedAny("UID_ADSDomain", "UID_ADSContainer", "cn"))871 {872 ISqlFormatter sqlFormatter = _003Csession_003E5__2.Resolve<ISqlFormatter>();873 global::_003C_003Ey__InlineArray9<string> buffer = default(global::_003C_003Ey__InlineArray9<string>);874 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 0) = "(";875 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 1) = sqlFormatter.FormatValue(entity.Columns["cn"].GetValue<string>(), ValType.String, forUpdate: true);876 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 2) = ", ";877 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 3) = sqlFormatter.FormatUidValue(entity.Columns["UID_ADSContainer"].GetValue<string>());878 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 4) = ", ";879 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 5) = sqlFormatter.FormatUidValue(entity.Columns["UID_ADSDomain"].GetValue<string>());880 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 6) = ", ";881 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 7) = sqlFormatter.FormatUidValue(entity.Columns["XObjectKey"].GetValue<string>());882 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 8) = ")";883 string data = string.Concat(global::_003CPrivateImplementationDetails_003E.InlineArrayAsReadOnlySpan<global::_003C_003Ey__InlineArray9<string>, string>(in buffer, 9));884 parameters.Session.AddPreCommitHook("ADS_UniqueCnCheck", data, ADSHelper.IsUniqueCnInAdsBulk);885 }886 if (entity.Columns.ChangedAny("SAMAccountName", "UID_ADSDomain"))887 {888 ISqlFormatter sqlFormatter2 = _003Csession_003E5__2.Resolve<ISqlFormatter>();889 global::_003C_003Ey__InlineArray7<string> buffer2 = default(global::_003C_003Ey__InlineArray7<string>);890 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<string>, string>(ref buffer2, 0) = "(";891 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<string>, string>(ref buffer2, 1) = sqlFormatter2.FormatValue(entity.Columns["SAMAccountName"].GetValue<string>(), ValType.String, forUpdate: true);892 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<string>, string>(ref buffer2, 2) = ", ";893 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<string>, string>(ref buffer2, 3) = sqlFormatter2.FormatUidValue(entity.Columns["UID_ADSDomain"].GetValue<string>());894 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<string>, string>(ref buffer2, 4) = ", ";895 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<string>, string>(ref buffer2, 5) = sqlFormatter2.FormatUidValue(entity.Columns["XObjectKey"].GetValue<string>());896 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<string>, string>(ref buffer2, 6) = ")";897 string data2 = string.Concat(global::_003CPrivateImplementationDetails_003E.InlineArrayAsReadOnlySpan<global::_003C_003Ey__InlineArray7<string>, string>(in buffer2, 7));898 parameters.Session.AddPreCommitHook("ADS_UniqueSamAccountCheck", data2, ADSHelper.IsUniqueSamAccountBulk);899 }900 if (!entity.IsLoaded)901 {902 val3 = aDSAccount.CheckADSPrimaryGroup(_003Csession_003E5__2, entity, entity.GetValue<string>("UID_ADSGroupPrimary"), _003CuidAdsDomain_003E5__3, ct).ConfigureAwait(false).GetAwaiter();903 if (!val3.IsCompleted)904 {905 num = (_003C_003E1__state = 2);906 _003C_003Eu__3 = val3;907 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<bool>, _003COnSavingAsync_003Ed__12>(ref val3, ref this);908 return;909 }910 goto IL_05d7;911 }912 goto IL_05df;913 IL_05df:914 if (entity.Columns["UID_ADSContainer"].IsDifferent && !entity.IsDeleted())915 {916 val5 = ADSHelper.CheckContainerLimit(parameters.Session, entity, parameters.UnitOfWork, ct).ConfigureAwait(false);917 val2 = ((ConfiguredTaskAwaitable)(ref val5)).GetAwaiter();918 if (!((ConfiguredTaskAwaiter)(ref val2)).IsCompleted)919 {920 num = (_003C_003E1__state = 3);921 _003C_003Eu__2 = val2;922 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnSavingAsync_003Ed__12>(ref val2, ref this);923 return;924 }925 goto IL_0690;926 }927 goto IL_0697;928 IL_0697:929 val = ((DirectoryObjectEntityLogic)aDSAccount).OnSavingAsync(entity, parameters, ct).ConfigureAwait(false).GetAwaiter();930 if (!val.IsCompleted)931 {932 num = (_003C_003E1__state = 4);933 _003C_003Eu__4 = val;934 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<Diff>, _003COnSavingAsync_003Ed__12>(ref val, ref this);935 return;936 }937 break;938 IL_0110:939 if (!new DbVal(val4.GetResult()).Bool)940 {941 val5 = ADSHelper.IsComplexPassword(aDSAccount._password, parameters.Session, entity, parameters.CreateWalker(entity), ct).ConfigureAwait(false);942 val2 = ((ConfiguredTaskAwaitable)(ref val5)).GetAwaiter();943 if (!((ConfiguredTaskAwaiter)(ref val2)).IsCompleted)944 {945 num = (_003C_003E1__state = 1);946 _003C_003Eu__2 = val2;947 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnSavingAsync_003Ed__12>(ref val2, ref this);948 return;949 }950 goto IL_01b4;951 }952 goto IL_01bb;953 IL_05d7:954 val3.GetResult();955 goto IL_05df;956 IL_0690:957 ((ConfiguredTaskAwaiter)(ref val2)).GetResult();958 goto IL_0697;959 }960 result = val.GetResult();961 }962 catch (System.Exception exception)963 {964 _003C_003E1__state = -2;965 _003Csession_003E5__2 = null;966 _003CuidAdsDomain_003E5__3 = null;967 _003C_003Et__builder.SetException(exception);968 return;969 }970 _003C_003E1__state = -2;971 _003Csession_003E5__2 = null;972 _003CuidAdsDomain_003E5__3 = null;973 _003C_003Et__builder.SetResult(result);974 }975976 [DebuggerHidden]977 private void SetStateMachine(IAsyncStateMachine stateMachine)978 {979 _003C_003Et__builder.SetStateMachine(stateMachine);980 }981 }982983 [StructLayout((LayoutKind)3)]984 [CompilerGenerated]985 private struct _003CRemoveMemberShips_003Ed__10 : IAsyncStateMachine986 {987 public int _003C_003E1__state;988989 public AsyncTaskMethodBuilder _003C_003Et__builder;990991 public IEntity entity;992993 public ISession session;994995 public CancellationToken ct;996997 public IUnitOfWork uow;998999 private ConfiguredTaskAwaiter<IEntityCollection> _003C_003Eu__1;10001001 private System.Collections.Generic.IEnumerator<IEntity> _003C_003E7__wrap1;10021003 private ConfiguredTaskAwaiter _003C_003Eu__2;10041005 private void MoveNext()1006 {1007 //IL_00b2: Unknown result type (might be due to invalid IL or missing references)1008 //IL_00b7: Unknown result type (might be due to invalid IL or missing references)1009 //IL_00bf: Unknown result type (might be due to invalid IL or missing references)1010 //IL_0069: Unknown result type (might be due to invalid IL or missing references)1011 //IL_0074: Unknown result type (might be due to invalid IL or missing references)1012 //IL_0079: Unknown result type (might be due to invalid IL or missing references)1013 //IL_007d: Unknown result type (might be due to invalid IL or missing references)1014 //IL_0082: Unknown result type (might be due to invalid IL or missing references)1015 //IL_0097: Unknown result type (might be due to invalid IL or missing references)1016 //IL_0099: Unknown result type (might be due to invalid IL or missing references)1017 //IL_0153: Unknown result type (might be due to invalid IL or missing references)1018 //IL_0158: Unknown result type (might be due to invalid IL or missing references)1019 //IL_0160: Unknown result type (might be due to invalid IL or missing references)1020 //IL_010a: Unknown result type (might be due to invalid IL or missing references)1021 //IL_0115: Unknown result type (might be due to invalid IL or missing references)1022 //IL_011a: Unknown result type (might be due to invalid IL or missing references)1023 //IL_011e: Unknown result type (might be due to invalid IL or missing references)1024 //IL_0123: Unknown result type (might be due to invalid IL or missing references)1025 //IL_0138: Unknown result type (might be due to invalid IL or missing references)1026 //IL_013a: Unknown result type (might be due to invalid IL or missing references)1027 int num = _003C_003E1__state;1028 try1029 {1030 ConfiguredTaskAwaiter<IEntityCollection> val;1031 if (num != 0)1032 {1033 if (num == 1)1034 {1035 goto IL_00e3;1036 }1037 _003C_003Ec__DisplayClass10_0 CS_0024_003C_003E8__locals1 = new _003C_003Ec__DisplayClass10_01038 {1039 uidAdsAccount = entity.Columns["UID_ADSAccount"].GetValue<string>()1040 };1041 Query query = (from c in Query.From("ADSAccountInADSGroup")1042 where c.Column("UID_ADSAccount") == CS_0024_003C_003E8__locals1.uidAdsAccount && c.Column("XOrigin") == 11043 select c).SelectDisplays();1044 val = session.Source().GetCollectionAsync(query, EntityCollectionLoadType.Bulk, ct).ConfigureAwait(false)1045 .GetAwaiter();1046 if (!val.IsCompleted)1047 {1048 num = (_003C_003E1__state = 0);1049 _003C_003Eu__1 = val;1050 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntityCollection>, _003CRemoveMemberShips_003Ed__10>(ref val, ref this);1051 return;1052 }1053 }1054 else1055 {1056 val = _003C_003Eu__1;1057 _003C_003Eu__1 = default(ConfiguredTaskAwaiter<IEntityCollection>);1058 num = (_003C_003E1__state = -1);1059 }1060 IEntityCollection result = val.GetResult();1061 _003C_003E7__wrap1 = ((System.Collections.Generic.IEnumerable<IEntity>)result).GetEnumerator();1062 goto IL_00e3;1063 IL_00e3:1064 try1065 {1066 if (num != 1)1067 {1068 goto IL_0176;1069 }1070 ConfiguredTaskAwaiter val2 = _003C_003Eu__2;1071 _003C_003Eu__2 = default(ConfiguredTaskAwaiter);1072 num = (_003C_003E1__state = -1);1073 goto IL_016f;1074 IL_016f:1075 ((ConfiguredTaskAwaiter)(ref val2)).GetResult();1076 goto IL_0176;1077 IL_0176:1078 if (((System.Collections.IEnumerator)_003C_003E7__wrap1).MoveNext())1079 {1080 IEntity current = _003C_003E7__wrap1.Current;1081 current.MarkForDeletion();1082 ConfiguredTaskAwaitable val3 = uow.PutAsync(current, null, ct).ConfigureAwait(false);1083 val2 = ((ConfiguredTaskAwaitable)(ref val3)).GetAwaiter();1084 if (!((ConfiguredTaskAwaiter)(ref val2)).IsCompleted)1085 {1086 num = (_003C_003E1__state = 1);1087 _003C_003Eu__2 = val2;1088 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003CRemoveMemberShips_003Ed__10>(ref val2, ref this);1089 return;1090 }1091 goto IL_016f;1092 }1093 }1094 finally1095 {1096 if (num < 0 && _003C_003E7__wrap1 != null)1097 {1098 ((System.IDisposable)_003C_003E7__wrap1).Dispose();1099 }1100 }1101 _003C_003E7__wrap1 = null;1102 }1103 catch (System.Exception exception)1104 {1105 _003C_003E1__state = -2;1106 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);1107 return;1108 }1109 _003C_003E1__state = -2;1110 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();1111 }11121113 [DebuggerHidden]1114 private void SetStateMachine(IAsyncStateMachine stateMachine)1115 {1116 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);1117 }1118 }11191120 [StructLayout((LayoutKind)3)]1121 [CompilerGenerated]1122 private struct _003CUpdatePrimaryGroup_003Ed__11 : IAsyncStateMachine1123 {1124 public int _003C_003E1__state;11251126 public AsyncTaskMethodBuilder _003C_003Et__builder;11271128 public IEntity entity;11291130 public ISession session;11311132 public CancellationToken ct;11331134 private _003C_003Ec__DisplayClass11_0 _003C_003E8__1;11351136 private ConfiguredTaskAwaiter<IEntityCollection> _003C_003Eu__1;11371138 private ConfiguredTaskAwaiter<string> _003C_003Eu__2;11391140 private ConfiguredValueTaskAwaiter<ApplyResult> _003C_003Eu__3;11411142 private void MoveNext()1143 {1144 //IL_00d4: Unknown result type (might be due to invalid IL or missing references)1145 //IL_00d9: Unknown result type (might be due to invalid IL or missing references)1146 //IL_00e1: Unknown result type (might be due to invalid IL or missing references)1147 //IL_0169: Unknown result type (might be due to invalid IL or missing references)1148 //IL_016e: Unknown result type (might be due to invalid IL or missing references)1149 //IL_0176: Unknown result type (might be due to invalid IL or missing references)1150 //IL_0219: Unknown result type (might be due to invalid IL or missing references)1151 //IL_021e: Unknown result type (might be due to invalid IL or missing references)1152 //IL_0226: Unknown result type (might be due to invalid IL or missing references)1153 //IL_008b: Unknown result type (might be due to invalid IL or missing references)1154 //IL_0096: Unknown result type (might be due to invalid IL or missing references)1155 //IL_009b: Unknown result type (might be due to invalid IL or missing references)1156 //IL_009f: Unknown result type (might be due to invalid IL or missing references)1157 //IL_00a4: Unknown result type (might be due to invalid IL or missing references)1158 //IL_00b9: Unknown result type (might be due to invalid IL or missing references)1159 //IL_00bb: Unknown result type (might be due to invalid IL or missing references)1160 //IL_01cf: Unknown result type (might be due to invalid IL or missing references)1161 //IL_01de: Unknown result type (might be due to invalid IL or missing references)1162 //IL_01e3: Unknown result type (might be due to invalid IL or missing references)1163 //IL_01e7: Unknown result type (might be due to invalid IL or missing references)1164 //IL_01ec: Unknown result type (might be due to invalid IL or missing references)1165 //IL_0120: Unknown result type (might be due to invalid IL or missing references)1166 //IL_012b: Unknown result type (might be due to invalid IL or missing references)1167 //IL_0130: Unknown result type (might be due to invalid IL or missing references)1168 //IL_0134: Unknown result type (might be due to invalid IL or missing references)1169 //IL_0139: Unknown result type (might be due to invalid IL or missing references)1170 //IL_0201: Unknown result type (might be due to invalid IL or missing references)1171 //IL_0203: Unknown result type (might be due to invalid IL or missing references)1172 //IL_014e: Unknown result type (might be due to invalid IL or missing references)1173 //IL_0150: Unknown result type (might be due to invalid IL or missing references)1174 int num = _003C_003E1__state;1175 try1176 {1177 ConfiguredTaskAwaiter<IEntityCollection> val3;1178 ConfiguredTaskAwaiter<string> val2;1179 ConfiguredValueTaskAwaiter<ApplyResult> val;1180 string result;1181 IEntityCollection result2;1182 string value;1183 switch (num)1184 {1185 default:1186 {1187 _003C_003E8__1 = new _003C_003Ec__DisplayClass11_0();1188 _003C_003E8__1.uidAdsDomain = entity.Columns["UID_ADSDomain"].GetValue<string>();1189 Query query = (from c in Query.From("ADSGroup")1190 where c.Column("UID_ADSDomain") == _003C_003E8__1.uidAdsDomain && c.Column("PrimaryGroupToken") == "513"1191 select c).Select("UID_ADSGroup");1192 val3 = session.Source().GetCollectionAsync(query, EntityCollectionLoadType.BulkReadOnly, ct).ConfigureAwait(false)1193 .GetAwaiter();1194 if (!val3.IsCompleted)1195 {1196 num = (_003C_003E1__state = 0);1197 _003C_003Eu__1 = val3;1198 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntityCollection>, _003CUpdatePrimaryGroup_003Ed__11>(ref val3, ref this);1199 return;1200 }1201 goto IL_00f0;1202 }1203 case 0:1204 val3 = _003C_003Eu__1;1205 _003C_003Eu__1 = default(ConfiguredTaskAwaiter<IEntityCollection>);1206 num = (_003C_003E1__state = -1);1207 goto IL_00f0;1208 case 1:1209 val2 = _003C_003Eu__2;1210 _003C_003Eu__2 = default(ConfiguredTaskAwaiter<string>);1211 num = (_003C_003E1__state = -1);1212 goto IL_0185;1213 case 2:1214 {1215 val = _003C_003Eu__3;1216 _003C_003Eu__3 = default(ConfiguredValueTaskAwaiter<ApplyResult>);1217 num = (_003C_003E1__state = -1);1218 break;1219 }1220 IL_0185:1221 result = val2.GetResult();1222 throw new ViException(2105416, ExceptionRelevance.EndUser, result);1223 IL_00f0:1224 result2 = val3.GetResult();1225 if (((System.Collections.Generic.IReadOnlyCollection<IEntity>)result2).Count == 0)1226 {1227 val2 = DbObjectKey.GetObjectKey("ADSDomain", _003C_003E8__1.uidAdsDomain).GetObjectDisplayAsync(session, EntityCollectionLoadType.Default, ct).ConfigureAwait(false)1228 .GetAwaiter();1229 if (!val2.IsCompleted)1230 {1231 num = (_003C_003E1__state = 1);1232 _003C_003Eu__2 = val2;1233 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<string>, _003CUpdatePrimaryGroup_003Ed__11>(ref val2, ref this);1234 return;1235 }1236 goto IL_0185;1237 }1238 value = ((System.Collections.Generic.IReadOnlyList<IEntity>)result2)[0].GetValue<string>("UID_ADSGroup");1239 val = entity.Columns["UID_ADSGroupPrimary"].SetValueAsync(value, SetValueBehavior.Default, ct).ConfigureAwait(false).GetAwaiter();1240 if (!val.IsCompleted)1241 {1242 num = (_003C_003E1__state = 2);1243 _003C_003Eu__3 = val;1244 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<ApplyResult>, _003CUpdatePrimaryGroup_003Ed__11>(ref val, ref this);1245 return;1246 }1247 break;1248 }1249 val.GetResult();1250 }1251 catch (System.Exception exception)1252 {1253 _003C_003E1__state = -2;1254 _003C_003E8__1 = null;1255 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);1256 return;1257 }1258 _003C_003E1__state = -2;1259 _003C_003E8__1 = null;1260 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();1261 }12621263 [DebuggerHidden]1264 private void SetStateMachine(IAsyncStateMachine stateMachine)1265 {1266 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);1267 }1268 }12691270 private SecureString? _password;12711272 private static readonly DirectoryObjectEntityLogicParameter p = new DirectoryObjectEntityLogicParameter1273 {1274 Container = "UID_ADSContainer",1275 Domain = "UID_ADSDomain"1276 };12771278 public ADSAccount(EntityLogicConstructionParameters ep)1279 : base(ep, p)1280 {1281 RegisterExpensive("_IsMixedModeDomain").DependsOn("UID_ADSDomain").As<bool>((Func<ISession, IEntity, IEntityWalker, CancellationToken, System.Threading.Tasks.Task<bool>>)ADSHelper.InitMixedModeDomain);1282 using (base.Section.From("_NamespaceManagedBy").As<NameSpaceManagedBy>((Func<NameSpaceManagedBy, bool>)((NameSpaceManagedBy m) => m == NameSpaceManagedBy.VISYNC || m == NameSpaceManagedBy.ILM)))1283 {1284 MinLen("CanonicalName").Default(1);1285 }1286 Event("OverLimit").CustomGenerated();1287 using (base.Section.From("_NamespaceManagedBy").As<NameSpaceManagedBy>((Func<NameSpaceManagedBy, bool>)((NameSpaceManagedBy m) => m == NameSpaceManagedBy.VISYNC)))1288 {1289 MinLen("ObjectClass").Default(1);1290 using (base.Section.Except("SPECIAL(IsFullSync)"))1291 {1292 RadioGroup("AllowDialInByPolicy", "AllowDialIn");1293 Value("ProfileDirPath").From("Config(QER\\Person\\User\\PropertyMapping\\ProfileFromHome)", "HomeDirPath").As<string, string, TryResult<string>>((string strCP, string strHomeDirPath) => TryResult.FromResult(strCP == "1", strHomeDirPath));1294 Value("ProfileShare").From("Config(QER\\Person\\User\\PropertyMapping\\ProfileFromHome)", "HomeShare").As<string, string, TryResult<string>>((string strCP, string strHomeShare) => TryResult.FromResult(strCP == "1", strHomeShare));1295 Value("UID_ProfileServer").From("Config(QER\\Person\\User\\PropertyMapping\\ProfileFromHome)", "UID_HomeServer").As<string, string, TryResult<string>>((string strCP, string uidHomeServer) => TryResult.FromResult(strCP == "1", uidHomeServer));1296 MinLen("SamAccountName").Default(1);1297 RadioGroup("UserMustChangePassword", "PasswordNeverExpires");1298 RadioGroup("UserMustChangePassword", "UserCanNotChangePassword");1299 RadioGroup("RASAlwaysCallBack", "RASCallerSetCallBack", "RASNoCallBack");1300 MinLen("MSRADIUSCallBackNumber").From("RASAlwaysCallBack").As<bool>((Func<bool, int>)((bool bRASAlwaysCallBack) => bRASAlwaysCallBack ? 1 : 0));1301 CanEdit("TSInitialProgram", "TSWorkingDirectory").From("TSInheritInitialProgram").As<bool>((Func<bool, bool>)((bool b) => b)).ClearValueOnFalse();1302 CanEdit("TSRemoteInteractWithSession", "TSRemoteViewSession", "TSRemotePermissionRequired").From("TSRemoteEnable").As<bool>((Func<bool, bool>)((bool b) => b)).ClearValueOnFalse();1303 RadioGroup("TSRemoteInteractWithSession", "TSRemoteViewSession");1304 CanEdit("MSNPCALLINGSTATIONID", "MSRADIUSFRAMEDIPADDRESS", "MSRADIUSFRAMEDROUTE", "MSRADIUSSERVICETYPE").From("_IsMixedModeDomain", "AllowDialIn").As<bool, bool>((Func<bool, bool, bool>)((bool b1, bool b2) => !b1 && b2)).ClearValueOnFalse();1305 Check("UID_ADSGroupPrimary").AsExpensive<string>((Func<ISession, IEntity, string, CancellationToken, System.Threading.Tasks.Task<bool>>)([CompilerGenerated] (ISession s, IEntity e, string v, CancellationToken ct) => CheckADSPrimaryGroup(s, e, v, null, ct)));1306 CanEdit("UID_ADSGroupPrimary").From("[IsLoaded]").As<bool>((Func<bool, bool>)((bool isLoaded) => isLoaded));1307 MinLen("UID_ADSGroupPrimary").From("UID_ADSGroupPrimary[o]", "[IsLoaded]").As<string, bool>((Func<string, bool, int>)((string uid, bool isLoaded) => (!string.IsNullOrEmpty(uid) && isLoaded) ? 1 : 0));1308 Check("UserPassword").AsExpensive<string>((Func<ISession, IEntity, string, CancellationToken, System.Threading.Tasks.Task<bool>>)CheckUserPassword);1309 Format("OtherFax", "OtherHomePhone", "OtherIPPhone", "OtherMailbox", "OtherMobile", "OtherPager", "OtherTelephoneNumber", "OtherWWW").As<string, string>(FormatMVPValues);1310 Value("TSRemoteInteractWithSession").From("TSRemoteEnable").As<bool, bool>((bool b) => b);1311 RegisterExtendedMethod("Move").As<string, string, MP>((Func<ISession, IEntity, string, string, CancellationToken, System.Threading.Tasks.Task<MP>>)MoveDomain).OnSaving(MoveDomain_OnSaving).Visible()1312 .From("[IsLoaded]")1313 .As<bool>((Func<bool, bool>)((bool bLoaded) => bLoaded));1314 }1315 }1316 }13171318 private string FormatMVPValues(string mvpValue)1319 {1320 MultiValueProperty multiValueProperty = new MultiValueProperty(mvpValue);1321 int num = 0;1322 while (num < multiValueProperty.Count)1323 {1324 if (string.IsNullOrEmpty(multiValueProperty[num]))1325 {1326 multiValueProperty.RemoveAt(num);1327 }1328 else1329 {1330 num++;1331 }1332 }1333 return ((object)multiValueProperty).ToString();1334 }13351336 private System.Threading.Tasks.Task<bool> CheckUserPassword(ISession session, IEntity entity, string strPassword, CancellationToken ct)1337 {1338 if (session.Encryption() != null && session.Encryption().IsEncrypted(strPassword))1339 {1340 _password = null;1341 }1342 else1343 {1344 _password = strPassword.ToSecure();1345 }1346 return System.Threading.Tasks.Task.FromResult<bool>(true);1347 }13481349 [AsyncStateMachine(typeof(_003CCheckADSPrimaryGroup_003Ed__6))]1350 private async System.Threading.Tasks.Task<bool> CheckADSPrimaryGroup(ISession session, IEntity entity, string uidAdsGroupPrimary, string? uidAdsDomain, CancellationToken ct)1351 {1352 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1353 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1354 //IL_0037: Unknown result type (might be due to invalid IL or missing references)1355 //IL_0039: Unknown result type (might be due to invalid IL or missing references)1356 ISqlFormatter sqlFormatter = session.SqlFormatter();1357 if (base.IsInternalProcess)1358 {1359 return true;1360 }1361 if (string.IsNullOrEmpty(uidAdsGroupPrimary))1362 {1363 if (!string.IsNullOrEmpty((string)entity.GetValue("UID_ADSGroupPrimary")))1364 {1365 throw new ViException(2105197, ExceptionRelevance.EndUser);1366 }1367 }1368 else if (entity.IsLoaded)1369 {1370 string whereclause = sqlFormatter.AndRelation(sqlFormatter.UidComparison("UID_ADSAccount", entity.GetValue<string>("UID_ADSAccount")), sqlFormatter.UidComparison("UID_ADSGroup", uidAdsGroupPrimary));1371 if (!(await session.Source().ExistsAsync("ADSAccountInADSGroup", whereclause, ct).ConfigureAwait(false)))1372 {1373 throw new ViException(2105198, ExceptionRelevance.EndUser);1374 }1375 }1376 else if (!string.IsNullOrEmpty(uidAdsDomain))1377 {1378 string whereclause = sqlFormatter.AndRelation(sqlFormatter.UidComparison("UID_ADSDomain", uidAdsDomain), sqlFormatter.UidComparison("UID_ADSGroup", uidAdsGroupPrimary), sqlFormatter.Comparison("PrimaryGroupToken", "513", ValType.String));1379 if (!(await session.Source().ExistsAsync("ADSGroup", whereclause, ct).ConfigureAwait(false)))1380 {1381 throw new ViException(2105413, ExceptionRelevance.EndUser, "Domain Users");1382 }1383 }1384 return true;1385 }13861387 [AsyncStateMachine(typeof(_003CMoveDomain_003Ed__7))]1388 private async System.Threading.Tasks.Task<MP> MoveDomain(ISession session, IEntity entity, string uidNewDomain, string uidNewContainer, CancellationToken ct)1389 {1390 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1391 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1392 //IL_0037: Unknown result type (might be due to invalid IL or missing references)1393 //IL_0039: Unknown result type (might be due to invalid IL or missing references)1394 if (string.IsNullOrWhiteSpace(uidNewDomain))1395 {1396 throw new ArgumentException("'uidNewDomain' cannot be null or whitespace.", "uidNewDomain");1397 }1398 if (string.IsNullOrWhiteSpace(uidNewContainer))1399 {1400 throw new ArgumentException("'uidNewContainer' cannot be null or whitespace.", "uidNewContainer");1401 }1402 await CheckMove(session, entity, uidNewDomain, uidNewContainer, ct).ConfigureAwait(false);1403 return new MP1404 {1405 UidDomain = uidNewDomain,1406 UidContainer = uidNewContainer1407 };1408 }14091410 [AsyncStateMachine(typeof(_003CMoveDomain_OnSaving_003Ed__8))]1411 private System.Threading.Tasks.Task MoveDomain_OnSaving(IEntity entity, LogicReadWriteParameters parameter, MP moveParameter, CancellationToken ct)1412 {1413 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1414 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1415 //IL_002e: Unknown result type (might be due to invalid IL or missing references)1416 //IL_0030: Unknown result type (might be due to invalid IL or missing references)1417 _003CMoveDomain_OnSaving_003Ed__8 _003CMoveDomain_OnSaving_003Ed__ = default(_003CMoveDomain_OnSaving_003Ed__8);1418 _003CMoveDomain_OnSaving_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();1419 _003CMoveDomain_OnSaving_003Ed__._003C_003E4__this = this;1420 _003CMoveDomain_OnSaving_003Ed__.entity = entity;1421 _003CMoveDomain_OnSaving_003Ed__.parameter = parameter;1422 _003CMoveDomain_OnSaving_003Ed__.moveParameter = moveParameter;1423 _003CMoveDomain_OnSaving_003Ed__.ct = ct;1424 _003CMoveDomain_OnSaving_003Ed__._003C_003E1__state = -1;1425 ((AsyncTaskMethodBuilder)(ref _003CMoveDomain_OnSaving_003Ed__._003C_003Et__builder)).Start<_003CMoveDomain_OnSaving_003Ed__8>(ref _003CMoveDomain_OnSaving_003Ed__);1426 return ((AsyncTaskMethodBuilder)(ref _003CMoveDomain_OnSaving_003Ed__._003C_003Et__builder)).Task;1427 }14281429 [AsyncStateMachine(typeof(_003CCheckMove_003Ed__9))]1430 private System.Threading.Tasks.Task CheckMove(ISession session, IEntity entity, string uidNewDomain, string uidNewContainer, CancellationToken ct)1431 {1432 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1433 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1434 //IL_0037: Unknown result type (might be due to invalid IL or missing references)1435 //IL_0039: Unknown result type (might be due to invalid IL or missing references)1436 _003CCheckMove_003Ed__9 _003CCheckMove_003Ed__ = default(_003CCheckMove_003Ed__9);1437 _003CCheckMove_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();1438 _003CCheckMove_003Ed__._003C_003E4__this = this;1439 _003CCheckMove_003Ed__.session = session;1440 _003CCheckMove_003Ed__.entity = entity;1441 _003CCheckMove_003Ed__.uidNewDomain = uidNewDomain;1442 _003CCheckMove_003Ed__.uidNewContainer = uidNewContainer;1443 _003CCheckMove_003Ed__.ct = ct;1444 _003CCheckMove_003Ed__._003C_003E1__state = -1;1445 ((AsyncTaskMethodBuilder)(ref _003CCheckMove_003Ed__._003C_003Et__builder)).Start<_003CCheckMove_003Ed__9>(ref _003CCheckMove_003Ed__);1446 return ((AsyncTaskMethodBuilder)(ref _003CCheckMove_003Ed__._003C_003Et__builder)).Task;1447 }14481449 [AsyncStateMachine(typeof(_003CRemoveMemberShips_003Ed__10))]1450 private static System.Threading.Tasks.Task RemoveMemberShips(ISession session, IUnitOfWork uow, IEntity entity, CancellationToken ct)1451 {1452 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1453 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1454 //IL_0026: Unknown result type (might be due to invalid IL or missing references)1455 //IL_0027: Unknown result type (might be due to invalid IL or missing references)1456 _003CRemoveMemberShips_003Ed__10 _003CRemoveMemberShips_003Ed__ = default(_003CRemoveMemberShips_003Ed__10);1457 _003CRemoveMemberShips_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();1458 _003CRemoveMemberShips_003Ed__.session = session;1459 _003CRemoveMemberShips_003Ed__.uow = uow;1460 _003CRemoveMemberShips_003Ed__.entity = entity;1461 _003CRemoveMemberShips_003Ed__.ct = ct;1462 _003CRemoveMemberShips_003Ed__._003C_003E1__state = -1;1463 ((AsyncTaskMethodBuilder)(ref _003CRemoveMemberShips_003Ed__._003C_003Et__builder)).Start<_003CRemoveMemberShips_003Ed__10>(ref _003CRemoveMemberShips_003Ed__);1464 return ((AsyncTaskMethodBuilder)(ref _003CRemoveMemberShips_003Ed__._003C_003Et__builder)).Task;1465 }14661467 [AsyncStateMachine(typeof(_003CUpdatePrimaryGroup_003Ed__11))]1468 private static System.Threading.Tasks.Task UpdatePrimaryGroup(ISession session, IEntity entity, CancellationToken ct)1469 {1470 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1471 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1472 //IL_001e: Unknown result type (might be due to invalid IL or missing references)1473 //IL_001f: Unknown result type (might be due to invalid IL or missing references)1474 _003CUpdatePrimaryGroup_003Ed__11 _003CUpdatePrimaryGroup_003Ed__ = default(_003CUpdatePrimaryGroup_003Ed__11);1475 _003CUpdatePrimaryGroup_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();1476 _003CUpdatePrimaryGroup_003Ed__.session = session;1477 _003CUpdatePrimaryGroup_003Ed__.entity = entity;1478 _003CUpdatePrimaryGroup_003Ed__.ct = ct;1479 _003CUpdatePrimaryGroup_003Ed__._003C_003E1__state = -1;1480 ((AsyncTaskMethodBuilder)(ref _003CUpdatePrimaryGroup_003Ed__._003C_003Et__builder)).Start<_003CUpdatePrimaryGroup_003Ed__11>(ref _003CUpdatePrimaryGroup_003Ed__);1481 return ((AsyncTaskMethodBuilder)(ref _003CUpdatePrimaryGroup_003Ed__._003C_003Et__builder)).Task;1482 }14831484 [AsyncStateMachine(typeof(_003COnSavingAsync_003Ed__12))]1485 public override async System.Threading.Tasks.Task<Diff> OnSavingAsync(IEntity entity, LogicReadWriteParameters parameters, CancellationToken ct)1486 {1487 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1488 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1489 //IL_0026: Unknown result type (might be due to invalid IL or missing references)1490 //IL_0027: Unknown result type (might be due to invalid IL or missing references)1491 ISession session = parameters.Session;1492 string uidAdsDomain = entity.GetValue<string>("UID_ADSDomain");1493 ADSHelper.CheckIsProtectedFromAccidentalDel(session, entity);1494 if (!session.IsFullSync() && !entity.IsDeleted() && !string.IsNullOrEmpty(uidAdsDomain))1495 {1496 if (!new DbVal(await parameters.Session.Config().GetConfigParmAsync("TargetSystem\\ADS\\Accounts\\NotRequirePassword", ct).ConfigureAwait(false)).Bool)1497 {1498 await ADSHelper.IsComplexPassword(_password, parameters.Session, entity, parameters.CreateWalker(entity), ct).ConfigureAwait(false);1499 }1500 TSBHelper.RemoveEmptyValues(entity.Columns["OtherFax"]);1501 TSBHelper.RemoveEmptyValues(entity.Columns["OtherHomePhone"]);1502 TSBHelper.RemoveEmptyValues(entity.Columns["OtherIPPhone"]);1503 TSBHelper.RemoveEmptyValues(entity.Columns["OtherMailbox"]);1504 TSBHelper.RemoveEmptyValues(entity.Columns["OtherMobile"]);1505 TSBHelper.RemoveEmptyValues(entity.Columns["OtherPager"]);1506 TSBHelper.RemoveEmptyValues(entity.Columns["OtherTelephoneNumber"]);1507 TSBHelper.RemoveEmptyValues(entity.Columns["OtherWWW"]);1508 if (entity.Columns.ChangedAny("UID_ADSDomain", "UID_ADSContainer", "cn"))1509 {1510 ISqlFormatter sqlFormatter = session.Resolve<ISqlFormatter>();1511 global::_003C_003Ey__InlineArray9<string> buffer = default(global::_003C_003Ey__InlineArray9<string>);1512 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 0) = "(";1513 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 1) = sqlFormatter.FormatValue(entity.Columns["cn"].GetValue<string>(), ValType.String, forUpdate: true);1514 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 2) = ", ";1515 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 3) = sqlFormatter.FormatUidValue(entity.Columns["UID_ADSContainer"].GetValue<string>());1516 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 4) = ", ";1517 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 5) = sqlFormatter.FormatUidValue(entity.Columns["UID_ADSDomain"].GetValue<string>());1518 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 6) = ", ";1519 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 7) = sqlFormatter.FormatUidValue(entity.Columns["XObjectKey"].GetValue<string>());1520 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 8) = ")";1521 string data = string.Concat(global::_003CPrivateImplementationDetails_003E.InlineArrayAsReadOnlySpan<global::_003C_003Ey__InlineArray9<string>, string>(in buffer, 9));1522 parameters.Session.AddPreCommitHook("ADS_UniqueCnCheck", data, ADSHelper.IsUniqueCnInAdsBulk);1523 }1524 if (entity.Columns.ChangedAny("SAMAccountName", "UID_ADSDomain"))1525 {1526 ISqlFormatter sqlFormatter2 = session.Resolve<ISqlFormatter>();1527 global::_003C_003Ey__InlineArray7<string> buffer2 = default(global::_003C_003Ey__InlineArray7<string>);1528 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<string>, string>(ref buffer2, 0) = "(";1529 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<string>, string>(ref buffer2, 1) = sqlFormatter2.FormatValue(entity.Columns["SAMAccountName"].GetValue<string>(), ValType.String, forUpdate: true);1530 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<string>, string>(ref buffer2, 2) = ", ";1531 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<string>, string>(ref buffer2, 3) = sqlFormatter2.FormatUidValue(entity.Columns["UID_ADSDomain"].GetValue<string>());1532 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<string>, string>(ref buffer2, 4) = ", ";1533 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<string>, string>(ref buffer2, 5) = sqlFormatter2.FormatUidValue(entity.Columns["XObjectKey"].GetValue<string>());1534 global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<string>, string>(ref buffer2, 6) = ")";1535 string data2 = string.Concat(global::_003CPrivateImplementationDetails_003E.InlineArrayAsReadOnlySpan<global::_003C_003Ey__InlineArray7<string>, string>(in buffer2, 7));1536 parameters.Session.AddPreCommitHook("ADS_UniqueSamAccountCheck", data2, ADSHelper.IsUniqueSamAccountBulk);1537 }1538 if (!entity.IsLoaded)1539 {1540 await CheckADSPrimaryGroup(session, entity, entity.GetValue<string>("UID_ADSGroupPrimary"), uidAdsDomain, ct).ConfigureAwait(false);1541 }1542 }1543 if (entity.Columns["UID_ADSContainer"].IsDifferent && !entity.IsDeleted())1544 {1545 await ADSHelper.CheckContainerLimit(parameters.Session, entity, parameters.UnitOfWork, ct).ConfigureAwait(false);1546 }1547 return await base.OnSavingAsync(entity, parameters, ct).ConfigureAwait(false);1548 }15491550 [AsyncStateMachine(typeof(_003COnSavedAsync_003Ed__13))]1551 public override System.Threading.Tasks.Task OnSavedAsync(IEntity entity, LogicReadWriteParameters parameters, CancellationToken cancellationToken)1552 {1553 //IL_0002: Unknown result type (might be due to invalid IL or missing references)1554 //IL_0007: Unknown result type (might be due to invalid IL or missing references)1555 //IL_0026: Unknown result type (might be due to invalid IL or missing references)1556 //IL_0027: Unknown result type (might be due to invalid IL or missing references)1557 _003COnSavedAsync_003Ed__13 _003COnSavedAsync_003Ed__ = default(_003COnSavedAsync_003Ed__13);1558 _003COnSavedAsync_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();1559 _003COnSavedAsync_003Ed__._003C_003E4__this = this;1560 _003COnSavedAsync_003Ed__.entity = entity;1561 _003COnSavedAsync_003Ed__.parameters = parameters;1562 _003COnSavedAsync_003Ed__.cancellationToken = cancellationToken;1563 _003COnSavedAsync_003Ed__._003C_003E1__state = -1;1564 ((AsyncTaskMethodBuilder)(ref _003COnSavedAsync_003Ed__._003C_003Et__builder)).Start<_003COnSavedAsync_003Ed__13>(ref _003COnSavedAsync_003Ed__);1565 return ((AsyncTaskMethodBuilder)(ref _003COnSavedAsync_003Ed__._003C_003Et__builder)).Task;1566 }1567}1568