Back to OIM Explorer

ADS.Customizer/ADS.Customizer/ADSGroup.cs

Decompiler Source FileADS.Customizer.ADSGroupDecompiled Source

1 extracted method/event/call references in ADSGroup.

Source: F:\Claude\.tmp\oim-decompiled-full\0013_One_Identity_Manager_ADS.Customizer.dll\ADS.Customizer\ADSGroup.cs

Source size: 54.719 characters

Interpretation

  • Decompiled source file. Use method/event registrations and call-site extraction to connect back to DialogMethod, QBMEvent, and API layers.

Relations

  • CustomGenerated event: OverLimit at line 902

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 IT Shop related markers

Summary: classes ADSGroup, _003C_003Ec__DisplayClass5_0, _003C_003Ec__DisplayClass8_0, _003C_003Ec__DisplayClass9_0; methods _003C_CheckAdsContainer_003Eb__0, _003C_CheckGroupTypeChanging_003Eb__0, _003C_CheckGroupTypeChanged_003Eb__0, MoveNext, SetStateMachine, _CheckObjectKeyManager; references ADSContact, ADSContainer, ADSDomain, ADSGroup; markers reads entity values, references DB/Dialog objects, IT Shop related markers

Classes

ADSGroup _003C_003Ec__DisplayClass5_0 _003C_003Ec__DisplayClass8_0 _003C_003Ec__DisplayClass9_0

DB/Dialog object references

OIM key/entity markers

UID_ADSContainer UID_ADSDomain XObjectKey UID_ADSGroup ObjectKeyManager

API/entity calls

GetValue IsFullSync IsDeleted AddPreCommitHook GetValue From Source SqlFormatter MetaData Database PutValueAsync

Registrations / handlers

None extracted.

Complete Source

C#1.101 lines
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 TSB.Customizer;10using VI.Base;11using VI.DB;12using VI.DB.DataAccess;13using VI.DB.Entities;14using VI.DB.MetaData;1516namespace ADS.Customizer;1718public class ADSGroup : DirectoryObjectEntityLogic19{20	[CompilerGenerated]21	private sealed class _003C_003Ec__DisplayClass5_022	{23		public string uidContainer;2425		internal ExpressionClause _003C_CheckAdsContainer_003Eb__0(IExpressionContext c)26		{27			return c.Column("UID_ADSContainer") == uidContainer;28		}29	}3031	[CompilerGenerated]32	private sealed class _003C_003Ec__DisplayClass8_033	{34		public IEntity entity;3536		internal bool _003C_CheckGroupTypeChanging_003Eb__0(string strColumn)37		{38			return entity.Columns[strColumn].IsDifferent;39		}40	}4142	[CompilerGenerated]43	private sealed class _003C_003Ec__DisplayClass9_044	{45		public IEntity entity;4647		internal bool _003C_CheckGroupTypeChanged_003Eb__0(string strColumn)48		{49			return entity.Columns[strColumn].IsDifferent;50		}51	}5253	[StructLayout((LayoutKind)3)]54	[CompilerGenerated]55	private struct _003COnSavedAsync_003Ed__7 : IAsyncStateMachine56	{57		public int _003C_003E1__state;5859		public AsyncTaskMethodBuilder _003C_003Et__builder;6061		public LogicReadWriteParameters parameters;6263		public IEntity entity;6465		public CancellationToken ct;6667		public ADSGroup _003C_003E4__this;6869		private ConfiguredTaskAwaiter<bool> _003C_003Eu__1;7071		private ConfiguredTaskAwaiter _003C_003Eu__2;7273		private void MoveNext()74		{75			//IL_0098: Unknown result type (might be due to invalid IL or missing references)76			//IL_009d: Unknown result type (might be due to invalid IL or missing references)77			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)78			//IL_0121: Unknown result type (might be due to invalid IL or missing references)79			//IL_0126: Unknown result type (might be due to invalid IL or missing references)80			//IL_012e: Unknown result type (might be due to invalid IL or missing references)81			//IL_0198: Unknown result type (might be due to invalid IL or missing references)82			//IL_019d: Unknown result type (might be due to invalid IL or missing references)83			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)84			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)85			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)86			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)87			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)88			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)89			//IL_0152: Unknown result type (might be due to invalid IL or missing references)90			//IL_015d: Unknown result type (might be due to invalid IL or missing references)91			//IL_0162: Unknown result type (might be due to invalid IL or missing references)92			//IL_0166: Unknown result type (might be due to invalid IL or missing references)93			//IL_016b: Unknown result type (might be due to invalid IL or missing references)94			//IL_0106: Unknown result type (might be due to invalid IL or missing references)95			//IL_0108: Unknown result type (might be due to invalid IL or missing references)96			//IL_0180: Unknown result type (might be due to invalid IL or missing references)97			//IL_0182: Unknown result type (might be due to invalid IL or missing references)98			//IL_0052: Unknown result type (might be due to invalid IL or missing references)99			//IL_005d: Unknown result type (might be due to invalid IL or missing references)100			//IL_0062: Unknown result type (might be due to invalid IL or missing references)101			//IL_0065: Unknown result type (might be due to invalid IL or missing references)102			//IL_006a: Unknown result type (might be due to invalid IL or missing references)103			//IL_007e: Unknown result type (might be due to invalid IL or missing references)104			//IL_007f: Unknown result type (might be due to invalid IL or missing references)105			int num = _003C_003E1__state;106			ADSGroup aDSGroup = _003C_003E4__this;107			try108			{109				ConfiguredTaskAwaiter<bool> val2;110				ConfiguredTaskAwaiter val;111				ConfiguredTaskAwaitable val3;112				switch (num)113				{114				default:115					if (!parameters.Session.IsFullSync() && !entity.IsDeleted())116					{117						val2 = ADSHelper.CheckObjectKeyManager(entity, parameters, ct).ConfigureAwait(false).GetAwaiter();118						if (!val2.IsCompleted)119						{120							num = (_003C_003E1__state = 0);121							_003C_003Eu__1 = val2;122							((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<bool>, _003COnSavedAsync_003Ed__7>(ref val2, ref this);123							return;124						}125						goto IL_00b3;126					}127					goto IL_0144;128				case 0:129					val2 = _003C_003Eu__1;130					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<bool>);131					num = (_003C_003E1__state = -1);132					goto IL_00b3;133				case 1:134					val = _003C_003Eu__2;135					_003C_003Eu__2 = default(ConfiguredTaskAwaiter);136					num = (_003C_003E1__state = -1);137					goto IL_013d;138				case 2:139					{140						val = _003C_003Eu__2;141						_003C_003Eu__2 = default(ConfiguredTaskAwaiter);142						num = (_003C_003E1__state = -1);143						break;144					}145					IL_00b3:146					val2.GetResult();147					val3 = _CheckGroupTypeChanged(parameters.Session, entity, parameters.UnitOfWork, ct).ConfigureAwait(false);148					val = ((ConfiguredTaskAwaitable)(ref val3)).GetAwaiter();149					if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)150					{151						num = (_003C_003E1__state = 1);152						_003C_003Eu__2 = val;153						((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnSavedAsync_003Ed__7>(ref val, ref this);154						return;155					}156					goto IL_013d;157					IL_0144:158					val3 = ((StateBasedEntityLogic)aDSGroup).OnSavedAsync(entity, parameters, ct).ConfigureAwait(false);159					val = ((ConfiguredTaskAwaitable)(ref val3)).GetAwaiter();160					if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)161					{162						num = (_003C_003E1__state = 2);163						_003C_003Eu__2 = val;164						((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnSavedAsync_003Ed__7>(ref val, ref this);165						return;166					}167					break;168					IL_013d:169					((ConfiguredTaskAwaiter)(ref val)).GetResult();170					goto IL_0144;171				}172				((ConfiguredTaskAwaiter)(ref val)).GetResult();173			}174			catch (System.Exception exception)175			{176				_003C_003E1__state = -2;177				((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);178				return;179			}180			_003C_003E1__state = -2;181			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();182		}183184		[DebuggerHidden]185		private void SetStateMachine(IAsyncStateMachine stateMachine)186		{187			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);188		}189	}190191	[StructLayout((LayoutKind)3)]192	[CompilerGenerated]193	private struct _003COnSavingAsync_003Ed__6 : IAsyncStateMachine194	{195		public int _003C_003E1__state;196197		public AsyncTaskMethodBuilder<Diff> _003C_003Et__builder;198199		public LogicReadWriteParameters parameters;200201		public IEntity entity;202203		public ADSGroup _003C_003E4__this;204205		public CancellationToken ct;206207		private ISession _003Csession_003E5__2;208209		private ConfiguredTaskAwaiter<Diff> _003C_003Eu__1;210211		private ConfiguredTaskAwaiter<bool> _003C_003Eu__2;212213		private ConfiguredTaskAwaiter _003C_003Eu__3;214215		private void MoveNext()216		{217			//IL_014e: Unknown result type (might be due to invalid IL or missing references)218			//IL_0153: Unknown result type (might be due to invalid IL or missing references)219			//IL_015b: Unknown result type (might be due to invalid IL or missing references)220			//IL_04db: Unknown result type (might be due to invalid IL or missing references)221			//IL_04e0: Unknown result type (might be due to invalid IL or missing references)222			//IL_04e8: Unknown result type (might be due to invalid IL or missing references)223			//IL_0562: Unknown result type (might be due to invalid IL or missing references)224			//IL_0567: Unknown result type (might be due to invalid IL or missing references)225			//IL_056f: Unknown result type (might be due to invalid IL or missing references)226			//IL_061a: Unknown result type (might be due to invalid IL or missing references)227			//IL_061f: Unknown result type (might be due to invalid IL or missing references)228			//IL_0627: Unknown result type (might be due to invalid IL or missing references)229			//IL_0691: Unknown result type (might be due to invalid IL or missing references)230			//IL_0696: Unknown result type (might be due to invalid IL or missing references)231			//IL_069e: Unknown result type (might be due to invalid IL or missing references)232			//IL_0519: Unknown result type (might be due to invalid IL or missing references)233			//IL_0524: Unknown result type (might be due to invalid IL or missing references)234			//IL_0529: Unknown result type (might be due to invalid IL or missing references)235			//IL_052d: Unknown result type (might be due to invalid IL or missing references)236			//IL_0532: Unknown result type (might be due to invalid IL or missing references)237			//IL_064b: Unknown result type (might be due to invalid IL or missing references)238			//IL_0656: Unknown result type (might be due to invalid IL or missing references)239			//IL_065b: Unknown result type (might be due to invalid IL or missing references)240			//IL_065f: Unknown result type (might be due to invalid IL or missing references)241			//IL_0664: Unknown result type (might be due to invalid IL or missing references)242			//IL_0547: Unknown result type (might be due to invalid IL or missing references)243			//IL_0549: Unknown result type (might be due to invalid IL or missing references)244			//IL_0679: Unknown result type (might be due to invalid IL or missing references)245			//IL_067b: Unknown result type (might be due to invalid IL or missing references)246			//IL_05d1: Unknown result type (might be due to invalid IL or missing references)247			//IL_05dc: Unknown result type (might be due to invalid IL or missing references)248			//IL_05e1: Unknown result type (might be due to invalid IL or missing references)249			//IL_05e5: Unknown result type (might be due to invalid IL or missing references)250			//IL_05ea: Unknown result type (might be due to invalid IL or missing references)251			//IL_0105: Unknown result type (might be due to invalid IL or missing references)252			//IL_0110: Unknown result type (might be due to invalid IL or missing references)253			//IL_0115: Unknown result type (might be due to invalid IL or missing references)254			//IL_0119: Unknown result type (might be due to invalid IL or missing references)255			//IL_011e: Unknown result type (might be due to invalid IL or missing references)256			//IL_05ff: Unknown result type (might be due to invalid IL or missing references)257			//IL_0601: Unknown result type (might be due to invalid IL or missing references)258			//IL_0133: Unknown result type (might be due to invalid IL or missing references)259			//IL_0135: Unknown result type (might be due to invalid IL or missing references)260			//IL_0492: Unknown result type (might be due to invalid IL or missing references)261			//IL_049d: Unknown result type (might be due to invalid IL or missing references)262			//IL_04a2: Unknown result type (might be due to invalid IL or missing references)263			//IL_04a6: Unknown result type (might be due to invalid IL or missing references)264			//IL_04ab: Unknown result type (might be due to invalid IL or missing references)265			//IL_04c0: Unknown result type (might be due to invalid IL or missing references)266			//IL_04c2: Unknown result type (might be due to invalid IL or missing references)267			int num = _003C_003E1__state;268			ADSGroup aDSGroup = _003C_003E4__this;269			Diff result;270			try271			{272				ConfiguredTaskAwaiter<bool> val3;273				ConfiguredTaskAwaiter val2;274				ConfiguredTaskAwaiter<Diff> val;275				ConfiguredTaskAwaitable val4;276				switch (num)277				{278				default:279					_003Csession_003E5__2 = parameters.Session;280					if (!entity.GetValue<bool>("IsGlobal") && !entity.GetValue<bool>("IsLocal") && !entity.GetValue<bool>("IsUniversal"))281					{282						throw new ViException(2105083, ExceptionRelevance.EndUser, "global, local, universal");283					}284					if (!entity.GetValue<bool>("IsDistributionGroup") && !entity.GetValue<bool>("IsSecurity"))285					{286						throw new ViException(2105083, ExceptionRelevance.EndUser, "IsDistributionGroup, IsSecurity");287					}288					ADSHelper.CheckIsProtectedFromAccidentalDel(_003Csession_003E5__2, entity);289					if (string.IsNullOrEmpty(entity.GetValue<string>("UID_ADSDomain")))290					{291						val = ((DirectoryObjectEntityLogic)aDSGroup).OnSavingAsync(entity, parameters, ct).ConfigureAwait(false).GetAwaiter();292						if (!val.IsCompleted)293						{294							num = (_003C_003E1__state = 0);295							_003C_003Eu__1 = val;296							_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<Diff>, _003COnSavingAsync_003Ed__6>(ref val, ref this);297							return;298						}299						goto IL_016a;300					}301					if (!_003Csession_003E5__2.IsFullSync() && !entity.IsDeleted())302					{303						if (entity.Columns.ChangedAny("UID_ADSDomain", "UID_ADSContainer", "cn"))304						{305							ISqlFormatter sqlFormatter = _003Csession_003E5__2.Resolve<ISqlFormatter>();306							global::_003C_003Ey__InlineArray9<string> buffer = default(global::_003C_003Ey__InlineArray9<string>);307							global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 0) = "(";308							global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 1) = sqlFormatter.FormatValue(entity.Columns["cn"].GetValue<string>(), ValType.String, forUpdate: true);309							global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 2) = ", ";310							global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 3) = sqlFormatter.FormatUidValue(entity.Columns["UID_ADSContainer"].GetValue<string>());311							global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 4) = ", ";312							global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 5) = sqlFormatter.FormatUidValue(entity.Columns["UID_ADSDomain"].GetValue<string>());313							global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 6) = ", ";314							global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 7) = sqlFormatter.FormatUidValue(entity.Columns["XObjectKey"].GetValue<string>());315							global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 8) = ")";316							string data = string.Concat(global::_003CPrivateImplementationDetails_003E.InlineArrayAsReadOnlySpan<global::_003C_003Ey__InlineArray9<string>, string>(in buffer, 9));317							parameters.Session.AddPreCommitHook("ADS_UniqueCnCheck", data, ADSHelper.IsUniqueCnInAdsBulk);318						}319						if (entity.Columns.ChangedAny("SAMAccountName", "UID_ADSDomain"))320						{321							ISqlFormatter sqlFormatter2 = _003Csession_003E5__2.Resolve<ISqlFormatter>();322							global::_003C_003Ey__InlineArray7<string> buffer2 = default(global::_003C_003Ey__InlineArray7<string>);323							global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<string>, string>(ref buffer2, 0) = "(";324							global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<string>, string>(ref buffer2, 1) = sqlFormatter2.FormatValue(entity.Columns["SAMAccountName"].GetValue<string>(), ValType.String, forUpdate: true);325							global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<string>, string>(ref buffer2, 2) = ", ";326							global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<string>, string>(ref buffer2, 3) = sqlFormatter2.FormatUidValue(entity.Columns["UID_ADSDomain"].GetValue<string>());327							global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<string>, string>(ref buffer2, 4) = ", ";328							global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<string>, string>(ref buffer2, 5) = sqlFormatter2.FormatUidValue(entity.Columns["XObjectKey"].GetValue<string>());329							global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<string>, string>(ref buffer2, 6) = ")";330							string data2 = string.Concat(global::_003CPrivateImplementationDetails_003E.InlineArrayAsReadOnlySpan<global::_003C_003Ey__InlineArray7<string>, string>(in buffer2, 7));331							parameters.Session.AddPreCommitHook("ADS_UniqueSamAccountCheck", data2, ADSHelper.IsUniqueSamAccountBulk);332						}333						if (entity.GetValue<bool>("IsUniversal") && entity.GetValue<bool>("IsSecurity"))334						{335							val3 = ADSHelper.InitMixedModeDomain(_003Csession_003E5__2, entity, parameters.CreateWalker(entity), ct).ConfigureAwait(false).GetAwaiter();336							if (!val3.IsCompleted)337							{338								num = (_003C_003E1__state = 1);339								_003C_003Eu__2 = val3;340								_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<bool>, _003COnSavingAsync_003Ed__6>(ref val3, ref this);341								return;342							}343							goto IL_04f7;344						}345						goto IL_050c;346					}347					goto IL_063d;348				case 0:349					val = _003C_003Eu__1;350					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<Diff>);351					num = (_003C_003E1__state = -1);352					goto IL_016a;353				case 1:354					val3 = _003C_003Eu__2;355					_003C_003Eu__2 = default(ConfiguredTaskAwaiter<bool>);356					num = (_003C_003E1__state = -1);357					goto IL_04f7;358				case 2:359					val2 = _003C_003Eu__3;360					_003C_003Eu__3 = default(ConfiguredTaskAwaiter);361					num = (_003C_003E1__state = -1);362					goto IL_057e;363				case 3:364					val2 = _003C_003Eu__3;365					_003C_003Eu__3 = default(ConfiguredTaskAwaiter);366					num = (_003C_003E1__state = -1);367					goto IL_0636;368				case 4:369					{370						val = _003C_003Eu__1;371						_003C_003Eu__1 = default(ConfiguredTaskAwaiter<Diff>);372						num = (_003C_003E1__state = -1);373						break;374					}375					IL_04f7:376					if (val3.GetResult())377					{378						throw new ViException(2105163, ExceptionRelevance.EndUser);379					}380					goto IL_050c;381					IL_0636:382					((ConfiguredTaskAwaiter)(ref val2)).GetResult();383					goto IL_063d;384					IL_016a:385					result = val.GetResult();386					goto end_IL_000e;387					IL_050c:388					val4 = _CheckGroupTypeChanging(_003Csession_003E5__2, entity, ct).ConfigureAwait(false);389					val2 = ((ConfiguredTaskAwaitable)(ref val4)).GetAwaiter();390					if (!((ConfiguredTaskAwaiter)(ref val2)).IsCompleted)391					{392						num = (_003C_003E1__state = 2);393						_003C_003Eu__3 = val2;394						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnSavingAsync_003Ed__6>(ref val2, ref this);395						return;396					}397					goto IL_057e;398					IL_063d:399					val = ((DirectoryObjectEntityLogic)aDSGroup).OnSavingAsync(entity, parameters, ct).ConfigureAwait(false).GetAwaiter();400					if (!val.IsCompleted)401					{402						num = (_003C_003E1__state = 4);403						_003C_003Eu__1 = val;404						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<Diff>, _003COnSavingAsync_003Ed__6>(ref val, ref this);405						return;406					}407					break;408					IL_057e:409					((ConfiguredTaskAwaiter)(ref val2)).GetResult();410					if (entity.Columns["UID_ADSContainer"].IsDifferent && !entity.IsDeleted())411					{412						val4 = ADSHelper.CheckContainerLimit(parameters.Session, entity, parameters.UnitOfWork, ct).ConfigureAwait(false);413						val2 = ((ConfiguredTaskAwaitable)(ref val4)).GetAwaiter();414						if (!((ConfiguredTaskAwaiter)(ref val2)).IsCompleted)415						{416							num = (_003C_003E1__state = 3);417							_003C_003Eu__3 = val2;418							_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnSavingAsync_003Ed__6>(ref val2, ref this);419							return;420						}421						goto IL_0636;422					}423					goto IL_063d;424				}425				result = val.GetResult();426				end_IL_000e:;427			}428			catch (System.Exception exception)429			{430				_003C_003E1__state = -2;431				_003Csession_003E5__2 = null;432				_003C_003Et__builder.SetException(exception);433				return;434			}435			_003C_003E1__state = -2;436			_003Csession_003E5__2 = null;437			_003C_003Et__builder.SetResult(result);438		}439440		[DebuggerHidden]441		private void SetStateMachine(IAsyncStateMachine stateMachine)442		{443			_003C_003Et__builder.SetStateMachine(stateMachine);444		}445	}446447	[StructLayout((LayoutKind)3)]448	[CompilerGenerated]449	private struct _003C_CheckAdsContainer_003Ed__5 : IAsyncStateMachine450	{451		public int _003C_003E1__state;452453		public AsyncTaskMethodBuilder<bool> _003C_003Et__builder;454455		public string uidContainer;456457		public IEntity entity;458459		public ISession session;460461		public CancellationToken ct;462463		private string _003CuidDomain_003E5__2;464465		private ConfiguredTaskAwaiter<string> _003C_003Eu__1;466467		private void MoveNext()468		{469			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)470			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)471			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)472			//IL_0097: Unknown result type (might be due to invalid IL or missing references)473			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)474			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)475			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)476			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)477			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)478			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)479			int num = _003C_003E1__state;480			bool result;481			try482			{483				ConfiguredTaskAwaiter<string> val;484				if (num == 0)485				{486					val = _003C_003Eu__1;487					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<string>);488					num = (_003C_003E1__state = -1);489					goto IL_00fc;490				}491				_003C_003Ec__DisplayClass5_0 CS_0024_003C_003E8__locals2 = new _003C_003Ec__DisplayClass5_0492				{493					uidContainer = uidContainer494				};495				_003CuidDomain_003E5__2 = entity.GetValue("UID_ADSDomain");496				if (!string.IsNullOrEmpty(_003CuidDomain_003E5__2) && !string.IsNullOrEmpty(CS_0024_003C_003E8__locals2.uidContainer))497				{498					Query query = (from c in Query.From("ADSContainer")499						where c.Column("UID_ADSContainer") == CS_0024_003C_003E8__locals2.uidContainer500						select c).Select("UID_ADSDomain");501					val = session.Source().GetSingleValueAsync<string>(query, ct).ConfigureAwait(false)502						.GetAwaiter();503					if (!val.IsCompleted)504					{505						num = (_003C_003E1__state = 0);506						_003C_003Eu__1 = val;507						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<string>, _003C_CheckAdsContainer_003Ed__5>(ref val, ref this);508						return;509					}510					goto IL_00fc;511				}512				result = true;513				goto end_IL_0007;514				IL_00fc:515				string result2 = val.GetResult();516				if (!string.Equals(_003CuidDomain_003E5__2, result2))517				{518					throw new ViException(2105406, ExceptionRelevance.EndUser);519				}520				result = true;521				end_IL_0007:;522			}523			catch (System.Exception exception)524			{525				_003C_003E1__state = -2;526				_003CuidDomain_003E5__2 = null;527				_003C_003Et__builder.SetException(exception);528				return;529			}530			_003C_003E1__state = -2;531			_003CuidDomain_003E5__2 = null;532			_003C_003Et__builder.SetResult(result);533		}534535		[DebuggerHidden]536		private void SetStateMachine(IAsyncStateMachine stateMachine)537		{538			_003C_003Et__builder.SetStateMachine(stateMachine);539		}540	}541542	[StructLayout((LayoutKind)3)]543	[CompilerGenerated]544	private struct _003C_CheckGroupTypeChanged_003Ed__9 : IAsyncStateMachine545	{546		public int _003C_003E1__state;547548		public AsyncTaskMethodBuilder _003C_003Et__builder;549550		public IEntity entity;551552		public IUnitOfWork uow;553554		public CancellationToken ct;555556		public ISession session;557558		private _003C_003Ec__DisplayClass9_0 _003C_003E8__1;559560		private ConfiguredTaskAwaiter _003C_003Eu__1;561562		private ConfiguredTaskAwaiter<object> _003C_003Eu__2;563564		private void MoveNext()565		{566			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)567			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)568			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)569			//IL_0150: Unknown result type (might be due to invalid IL or missing references)570			//IL_015b: Unknown result type (might be due to invalid IL or missing references)571			//IL_0160: Unknown result type (might be due to invalid IL or missing references)572			//IL_0164: Unknown result type (might be due to invalid IL or missing references)573			//IL_0169: Unknown result type (might be due to invalid IL or missing references)574			//IL_0196: Unknown result type (might be due to invalid IL or missing references)575			//IL_019b: Unknown result type (might be due to invalid IL or missing references)576			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)577			//IL_017e: Unknown result type (might be due to invalid IL or missing references)578			//IL_0180: Unknown result type (might be due to invalid IL or missing references)579			//IL_008a: Unknown result type (might be due to invalid IL or missing references)580			//IL_0095: Unknown result type (might be due to invalid IL or missing references)581			//IL_009a: Unknown result type (might be due to invalid IL or missing references)582			//IL_009e: Unknown result type (might be due to invalid IL or missing references)583			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)584			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)585			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)586			int num = _003C_003E1__state;587			try588			{589				ConfiguredTaskAwaiter val;590				if (num == 0)591				{592					val = _003C_003Eu__1;593					_003C_003Eu__1 = default(ConfiguredTaskAwaiter);594					num = (_003C_003E1__state = -1);595					goto IL_00ef;596				}597				ConfiguredTaskAwaiter<object> val2;598				if (num == 1)599				{600					val2 = _003C_003Eu__2;601					_003C_003Eu__2 = default(ConfiguredTaskAwaiter<object>);602					num = (_003C_003E1__state = -1);603					goto IL_01b2;604				}605				_003C_003E8__1 = new _003C_003Ec__DisplayClass9_0();606				_003C_003E8__1.entity = entity;607				if (Enumerable.Any<string>((System.Collections.Generic.IEnumerable<string>)new string[6] { "UID_ADSDomain", "IsDistributionGroup", "IsGlobal", "IsLocal", "IsUniversal", "IsSecurity" }, (Func<string, bool>)((string strColumn) => _003C_003E8__1.entity.Columns[strColumn].IsDifferent)))608				{609					ConfiguredTaskAwaitable val3 = uow.FlushAsync(ct).ConfigureAwait(false);610					val = ((ConfiguredTaskAwaitable)(ref val3)).GetAwaiter();611					if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)612					{613						num = (_003C_003E1__state = 0);614						_003C_003Eu__1 = val;615						((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003C_CheckGroupTypeChanged_003Ed__9>(ref val, ref this);616						return;617					}618					goto IL_00ef;619				}620				goto end_IL_0007;621				IL_01b2:622				if ((int)DbVal.ConvertTo(val2.GetResult(), ValType.Int) == 0)623				{624					throw new ViException(2105389, ExceptionRelevance.EndUser);625				}626				goto end_IL_0007;627				IL_00ef:628				((ConfiguredTaskAwaiter)(ref val)).GetResult();629				ISqlFormatter sqlFormatter = session.SqlFormatter();630				IDbSession dbSession = session.Resolve<IDbSession>();631				string sqlStatement = sqlFormatter.FunctionCall(new SqlFunction("ADS", "GGetInfo", "FGIGroupChangeValid"), sqlFormatter.FormatUidValue(_003C_003E8__1.entity.GetValue<string>("UID_ADSGroup")));632				val2 = dbSession.SqlExecuteScalarAsync(sqlStatement, ct).ConfigureAwait(false).GetAwaiter();633				if (!val2.IsCompleted)634				{635					num = (_003C_003E1__state = 1);636					_003C_003Eu__2 = val2;637					((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<object>, _003C_CheckGroupTypeChanged_003Ed__9>(ref val2, ref this);638					return;639				}640				goto IL_01b2;641				end_IL_0007:;642			}643			catch (System.Exception exception)644			{645				_003C_003E1__state = -2;646				_003C_003E8__1 = null;647				((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);648				return;649			}650			_003C_003E1__state = -2;651			_003C_003E8__1 = null;652			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();653		}654655		[DebuggerHidden]656		private void SetStateMachine(IAsyncStateMachine stateMachine)657		{658			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);659		}660	}661662	[StructLayout((LayoutKind)3)]663	[CompilerGenerated]664	private struct _003C_CheckGroupTypeChanging_003Ed__8 : IAsyncStateMachine665	{666		public int _003C_003E1__state;667668		public AsyncTaskMethodBuilder _003C_003Et__builder;669670		public IEntity entity;671672		public ISession session;673674		public CancellationToken ct;675676		private ConfiguredTaskAwaiter<IMetaTable> _003C_003Eu__1;677678		private ConfiguredTaskAwaiter<object> _003C_003Eu__2;679680		private void MoveNext()681		{682			//IL_0117: Unknown result type (might be due to invalid IL or missing references)683			//IL_011c: Unknown result type (might be due to invalid IL or missing references)684			//IL_0124: Unknown result type (might be due to invalid IL or missing references)685			//IL_021b: Unknown result type (might be due to invalid IL or missing references)686			//IL_0220: Unknown result type (might be due to invalid IL or missing references)687			//IL_0228: Unknown result type (might be due to invalid IL or missing references)688			//IL_0354: Unknown result type (might be due to invalid IL or missing references)689			//IL_0359: Unknown result type (might be due to invalid IL or missing references)690			//IL_0361: Unknown result type (might be due to invalid IL or missing references)691			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)692			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)693			//IL_00de: Unknown result type (might be due to invalid IL or missing references)694			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)695			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)696			//IL_01d2: Unknown result type (might be due to invalid IL or missing references)697			//IL_01dd: Unknown result type (might be due to invalid IL or missing references)698			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)699			//IL_01e6: Unknown result type (might be due to invalid IL or missing references)700			//IL_01eb: Unknown result type (might be due to invalid IL or missing references)701			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)702			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)703			//IL_030e: Unknown result type (might be due to invalid IL or missing references)704			//IL_0319: Unknown result type (might be due to invalid IL or missing references)705			//IL_031e: Unknown result type (might be due to invalid IL or missing references)706			//IL_0322: Unknown result type (might be due to invalid IL or missing references)707			//IL_0327: Unknown result type (might be due to invalid IL or missing references)708			//IL_0200: Unknown result type (might be due to invalid IL or missing references)709			//IL_0202: Unknown result type (might be due to invalid IL or missing references)710			//IL_033c: Unknown result type (might be due to invalid IL or missing references)711			//IL_033e: Unknown result type (might be due to invalid IL or missing references)712			int num = _003C_003E1__state;713			try714			{715				ConfiguredTaskAwaiter<IMetaTable> val2;716				ConfiguredTaskAwaiter<object> val;717				IMetaTable result;718				IMetaTable result2;719				switch (num)720				{721				default:722				{723					_003C_003Ec__DisplayClass8_0 CS_0024_003C_003E8__locals10 = new _003C_003Ec__DisplayClass8_0724					{725						entity = entity726					};727					if (Enumerable.Any<string>((System.Collections.Generic.IEnumerable<string>)new string[6] { "UID_ADSContainer", "IsDistributionGroup", "IsGlobal", "IsLocal", "IsUniversal", "IsSecurity" }, (Func<string, bool>)((string strColumn) => CS_0024_003C_003E8__locals10.entity.Columns[strColumn].IsDifferent)))728					{729						if (CS_0024_003C_003E8__locals10.entity.Columns["IsGlobal"].GetOldValue<bool>() && CS_0024_003C_003E8__locals10.entity.Columns["IsLocal"].GetValue<bool>())730						{731							val2 = session.MetaData().GetTableAsync(CS_0024_003C_003E8__locals10.entity.Tablename, ct).ConfigureAwait(false)732								.GetAwaiter();733							if (!val2.IsCompleted)734							{735								num = (_003C_003E1__state = 0);736								_003C_003Eu__1 = val2;737								((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IMetaTable>, _003C_CheckGroupTypeChanging_003Ed__8>(ref val2, ref this);738								return;739							}740							goto IL_0133;741						}742						if (CS_0024_003C_003E8__locals10.entity.Columns["IsLocal"].GetOldValue<bool>() && CS_0024_003C_003E8__locals10.entity.Columns["IsGlobal"].GetValue<bool>())743						{744							val2 = session.MetaData().GetTableAsync(CS_0024_003C_003E8__locals10.entity.Tablename, ct).ConfigureAwait(false)745								.GetAwaiter();746							if (!val2.IsCompleted)747							{748								num = (_003C_003E1__state = 1);749								_003C_003Eu__1 = val2;750								((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IMetaTable>, _003C_CheckGroupTypeChanging_003Ed__8>(ref val2, ref this);751								return;752							}753							goto IL_0237;754						}755						if (CS_0024_003C_003E8__locals10.entity.Columns["IsSecurity"].IsDifferent && !CS_0024_003C_003E8__locals10.entity.GetValue<bool>("IsSecurity"))756						{757							ISqlFormatter formatter = session.SqlFormatter();758							IDbSession dbSession = session.Resolve<IDbSession>();759							string systemIdentifier = session.Database().SystemIdentifier;760							object obj = formatter.FormatUidValue(CS_0024_003C_003E8__locals10.entity.GetValue<string>("UID_ADSGroup"));761							string sqlStatement = SqlStrings.Format(systemIdentifier, "ADSGroup_CheckGroupTypeChange_PrimaryMembers", new System.ReadOnlySpan<object>(ref obj));762							val = dbSession.SqlExecuteScalarAsync(sqlStatement, ct).ConfigureAwait(false).GetAwaiter();763							if (!val.IsCompleted)764							{765								num = (_003C_003E1__state = 2);766								_003C_003Eu__2 = val;767								((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<object>, _003C_CheckGroupTypeChanging_003Ed__8>(ref val, ref this);768								return;769							}770							break;771						}772					}773					goto end_IL_0007;774				}775				case 0:776					val2 = _003C_003Eu__1;777					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<IMetaTable>);778					num = (_003C_003E1__state = -1);779					goto IL_0133;780				case 1:781					val2 = _003C_003Eu__1;782					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<IMetaTable>);783					num = (_003C_003E1__state = -1);784					goto IL_0237;785				case 2:786					{787						val = _003C_003Eu__2;788						_003C_003Eu__2 = default(ConfiguredTaskAwaiter<object>);789						num = (_003C_003E1__state = -1);790						break;791					}792					IL_0237:793					result = val2.GetResult();794					throw new ViException(2105388, ExceptionRelevance.EndUser, result.Columns["IsLocal"].Display, result.Columns["IsGlobal"].Display);795					IL_0133:796					result2 = val2.GetResult();797					throw new ViException(2105388, ExceptionRelevance.EndUser, result2.Columns["IsGlobal"].Display, result2.Columns["IsLocal"].Display);798				}799				if (DbVal.ConvertTo<int>(val.GetResult()) > 0)800				{801					throw new ViException(2105404, ExceptionRelevance.EndUser);802				}803				end_IL_0007:;804			}805			catch (System.Exception exception)806			{807				_003C_003E1__state = -2;808				((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);809				return;810			}811			_003C_003E1__state = -2;812			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();813		}814815		[DebuggerHidden]816		private void SetStateMachine(IAsyncStateMachine stateMachine)817		{818			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);819		}820	}821822	[StructLayout((LayoutKind)3)]823	[CompilerGenerated]824	private struct _003C_CheckObjectKeyManager_003Ed__2 : IAsyncStateMachine825	{826		public int _003C_003E1__state;827828		public AsyncTaskMethodBuilder<bool> _003C_003Et__builder;829830		public IEntity entity;831832		public CancellationToken ct;833834		private ConfiguredValueTaskAwaiter<ApplyResult> _003C_003Eu__1;835836		private void MoveNext()837		{838			//IL_0063: Unknown result type (might be due to invalid IL or missing references)839			//IL_0068: Unknown result type (might be due to invalid IL or missing references)840			//IL_006f: Unknown result type (might be due to invalid IL or missing references)841			//IL_001c: Unknown result type (might be due to invalid IL or missing references)842			//IL_002a: Unknown result type (might be due to invalid IL or missing references)843			//IL_002f: Unknown result type (might be due to invalid IL or missing references)844			//IL_0033: Unknown result type (might be due to invalid IL or missing references)845			//IL_0038: Unknown result type (might be due to invalid IL or missing references)846			//IL_004c: Unknown result type (might be due to invalid IL or missing references)847			//IL_004d: Unknown result type (might be due to invalid IL or missing references)848			int num = _003C_003E1__state;849			bool result;850			try851			{852				ConfiguredValueTaskAwaiter<ApplyResult> val;853				if (num != 0)854				{855					val = entity.PutValueAsync("AllowWriteMembers", false, ct).ConfigureAwait(false).GetAwaiter();856					if (!val.IsCompleted)857					{858						num = (_003C_003E1__state = 0);859						_003C_003Eu__1 = val;860						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<ApplyResult>, _003C_CheckObjectKeyManager_003Ed__2>(ref val, ref this);861						return;862					}863				}864				else865				{866					val = _003C_003Eu__1;867					_003C_003Eu__1 = default(ConfiguredValueTaskAwaiter<ApplyResult>);868					num = (_003C_003E1__state = -1);869				}870				val.GetResult();871				result = true;872			}873			catch (System.Exception exception)874			{875				_003C_003E1__state = -2;876				_003C_003Et__builder.SetException(exception);877				return;878			}879			_003C_003E1__state = -2;880			_003C_003Et__builder.SetResult(result);881		}882883		[DebuggerHidden]884		private void SetStateMachine(IAsyncStateMachine stateMachine)885		{886			_003C_003Et__builder.SetStateMachine(stateMachine);887		}888	}889890	private static readonly DirectoryObjectEntityLogicParameter P = new DirectoryObjectEntityLogicParameter891	{892		Container = "UID_ADSContainer",893		Domain = "UID_ADSDomain"894	};895896	public ADSGroup(EntityLogicConstructionParameters ep)897		: base(ep, P)898	{899		RegisterExpensive("_IsMixedModeDomain").DependsOn("UID_ADSDomain").As<bool>((Func<ISession, IEntity, IEntityWalker, CancellationToken, System.Threading.Tasks.Task<bool>>)ADSHelper.InitMixedModeDomain);900		Value("IsGlobal").Default(value: true);901		Value("IsSecurity").Default(value: true);902		Event("OverLimit").CustomGenerated();903		using (base.Section.From("_NamespaceManagedBy").As<NameSpaceManagedBy>((Func<NameSpaceManagedBy, bool>)((NameSpaceManagedBy m) => m == NameSpaceManagedBy.VISYNC || m == NameSpaceManagedBy.ILM)))904		{905			MinLen("CanonicalName").Default(1);906			RadioGroup("IsDistributionGroup", "IsSecurity");907			RadioGroup("IsGlobal", "IsLocal", "IsUniversal");908		}909		using (base.Section.From("_NamespaceManagedBy").As<NameSpaceManagedBy>((Func<NameSpaceManagedBy, bool>)((NameSpaceManagedBy m) => m == NameSpaceManagedBy.VISYNC)))910		{911			MinLen("ObjectClass").Default(1);912			MinLen("SAMAccountName").Default(1);913			MinLen("UID_ADSDomain").Default(1);914			using (base.Section.Except("SPECIAL(IsFullSync)"))915			{916				CanEdit("IsDistributionGroup").From("_IsMixedModeDomain").As<bool>((Func<bool, bool>)((bool bMixed) => !bMixed)).ClearValueOnFalse();917				CanEdit("AllowWriteMembers").From("ObjectKeyManager").As<string>((Func<string, bool>)((string okManager) => _CanEditAllowWriteMembers(okManager))).ClearValueOnFalse();918				Check("ObjectKeyManager").AsExpensive<string>((Func<ISession, IEntity, string, CancellationToken, System.Threading.Tasks.Task<bool>>)_CheckObjectKeyManager);919				CanEdit("UID_ADSDomain").From("[IsLoaded]", "UID_ADSDomain").As<bool, string>((Func<bool, string, bool>)((bool isLoaded, string adsDomain) => !isLoaded || string.IsNullOrEmpty(adsDomain)));920				Check("UID_ADSDomain").With("FK(UID_ADSContainer).UID_ADSDomain").As<string, string>((Func<string, string, bool>)_CheckUidAdsDomain);921				Check("UID_ADSContainer").AsExpensive<string>((Func<ISession, IEntity, string, CancellationToken, System.Threading.Tasks.Task<bool>>)_CheckAdsContainer).DependsOn("UID_ADSDomain");922				CanEdit("IsForITShop", "IsITShopOnly").From("HasReadOnlyMemberships").As<bool>((Func<bool, bool>)((bool hasRoM) => !hasRoM)).ClearValueOnFalse();923			}924		}925	}926927	[AsyncStateMachine(typeof(_003C_CheckObjectKeyManager_003Ed__2))]928	private async System.Threading.Tasks.Task<bool> _CheckObjectKeyManager(ISession session, IEntity entity, string okManager, CancellationToken ct)929	{930		//IL_0002: Unknown result type (might be due to invalid IL or missing references)931		//IL_0007: Unknown result type (might be due to invalid IL or missing references)932		//IL_0016: Unknown result type (might be due to invalid IL or missing references)933		//IL_0018: Unknown result type (might be due to invalid IL or missing references)934		await entity.PutValueAsync("AllowWriteMembers", false, ct).ConfigureAwait(false);935		return true;936	}937938	private static bool _CanEditAllowWriteMembers(string okManager)939	{940		if (string.IsNullOrEmpty(okManager))941		{942			return false;943		}944		return !string.Equals(new DbObjectKey(okManager).Tablename, "ADSContact", (StringComparison)5);945	}946947	private static bool _CheckUidAdsDomain(string uidDomain, string uidContainer)948	{949		if (string.IsNullOrEmpty(uidDomain) || string.IsNullOrEmpty(uidContainer))950		{951			return true;952		}953		if (!string.Equals(uidDomain, uidContainer))954		{955			throw new ViException(2105406, ExceptionRelevance.EndUser);956		}957		return true;958	}959960	[AsyncStateMachine(typeof(_003C_CheckAdsContainer_003Ed__5))]961	private static async System.Threading.Tasks.Task<bool> _CheckAdsContainer(ISession session, IEntity entity, string uidContainer, CancellationToken ct)962	{963		//IL_0002: Unknown result type (might be due to invalid IL or missing references)964		//IL_0007: Unknown result type (might be due to invalid IL or missing references)965		//IL_0026: Unknown result type (might be due to invalid IL or missing references)966		//IL_0027: Unknown result type (might be due to invalid IL or missing references)967		string uidDomain = entity.GetValue("UID_ADSDomain");968		if (string.IsNullOrEmpty(uidDomain) || string.IsNullOrEmpty(uidContainer))969		{970			return true;971		}972		Query query = (from c in Query.From("ADSContainer")973			where c.Column("UID_ADSContainer") == uidContainer974			select c).Select("UID_ADSDomain");975		if (!string.Equals(uidDomain, await session.Source().GetSingleValueAsync<string>(query, ct).ConfigureAwait(false)))976		{977			throw new ViException(2105406, ExceptionRelevance.EndUser);978		}979		return true;980	}981982	[AsyncStateMachine(typeof(_003COnSavingAsync_003Ed__6))]983	public override async System.Threading.Tasks.Task<Diff> OnSavingAsync(IEntity entity, LogicReadWriteParameters parameters, CancellationToken ct)984	{985		//IL_0002: Unknown result type (might be due to invalid IL or missing references)986		//IL_0007: Unknown result type (might be due to invalid IL or missing references)987		//IL_0026: Unknown result type (might be due to invalid IL or missing references)988		//IL_0027: Unknown result type (might be due to invalid IL or missing references)989		ISession session = parameters.Session;990		if (!entity.GetValue<bool>("IsGlobal") && !entity.GetValue<bool>("IsLocal") && !entity.GetValue<bool>("IsUniversal"))991		{992			throw new ViException(2105083, ExceptionRelevance.EndUser, "global, local, universal");993		}994		if (!entity.GetValue<bool>("IsDistributionGroup") && !entity.GetValue<bool>("IsSecurity"))995		{996			throw new ViException(2105083, ExceptionRelevance.EndUser, "IsDistributionGroup, IsSecurity");997		}998		ADSHelper.CheckIsProtectedFromAccidentalDel(session, entity);999		if (string.IsNullOrEmpty(entity.GetValue<string>("UID_ADSDomain")))1000		{1001			return await base.OnSavingAsync(entity, parameters, ct).ConfigureAwait(false);1002		}1003		if (!session.IsFullSync() && !entity.IsDeleted())1004		{1005			if (entity.Columns.ChangedAny("UID_ADSDomain", "UID_ADSContainer", "cn"))1006			{1007				ISqlFormatter sqlFormatter = session.Resolve<ISqlFormatter>();1008				global::_003C_003Ey__InlineArray9<string> buffer = default(global::_003C_003Ey__InlineArray9<string>);1009				global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 0) = "(";1010				global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 1) = sqlFormatter.FormatValue(entity.Columns["cn"].GetValue<string>(), ValType.String, forUpdate: true);1011				global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 2) = ", ";1012				global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 3) = sqlFormatter.FormatUidValue(entity.Columns["UID_ADSContainer"].GetValue<string>());1013				global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 4) = ", ";1014				global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 5) = sqlFormatter.FormatUidValue(entity.Columns["UID_ADSDomain"].GetValue<string>());1015				global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 6) = ", ";1016				global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 7) = sqlFormatter.FormatUidValue(entity.Columns["XObjectKey"].GetValue<string>());1017				global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray9<string>, string>(ref buffer, 8) = ")";1018				string data = string.Concat(global::_003CPrivateImplementationDetails_003E.InlineArrayAsReadOnlySpan<global::_003C_003Ey__InlineArray9<string>, string>(in buffer, 9));1019				parameters.Session.AddPreCommitHook("ADS_UniqueCnCheck", data, ADSHelper.IsUniqueCnInAdsBulk);1020			}1021			if (entity.Columns.ChangedAny("SAMAccountName", "UID_ADSDomain"))1022			{1023				ISqlFormatter sqlFormatter2 = session.Resolve<ISqlFormatter>();1024				global::_003C_003Ey__InlineArray7<string> buffer2 = default(global::_003C_003Ey__InlineArray7<string>);1025				global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<string>, string>(ref buffer2, 0) = "(";1026				global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<string>, string>(ref buffer2, 1) = sqlFormatter2.FormatValue(entity.Columns["SAMAccountName"].GetValue<string>(), ValType.String, forUpdate: true);1027				global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<string>, string>(ref buffer2, 2) = ", ";1028				global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<string>, string>(ref buffer2, 3) = sqlFormatter2.FormatUidValue(entity.Columns["UID_ADSDomain"].GetValue<string>());1029				global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<string>, string>(ref buffer2, 4) = ", ";1030				global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<string>, string>(ref buffer2, 5) = sqlFormatter2.FormatUidValue(entity.Columns["XObjectKey"].GetValue<string>());1031				global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray7<string>, string>(ref buffer2, 6) = ")";1032				string data2 = string.Concat(global::_003CPrivateImplementationDetails_003E.InlineArrayAsReadOnlySpan<global::_003C_003Ey__InlineArray7<string>, string>(in buffer2, 7));1033				parameters.Session.AddPreCommitHook("ADS_UniqueSamAccountCheck", data2, ADSHelper.IsUniqueSamAccountBulk);1034			}1035			if (entity.GetValue<bool>("IsUniversal") && entity.GetValue<bool>("IsSecurity") && await ADSHelper.InitMixedModeDomain(session, entity, parameters.CreateWalker(entity), ct).ConfigureAwait(false))1036			{1037				throw new ViException(2105163, ExceptionRelevance.EndUser);1038			}1039			await _CheckGroupTypeChanging(session, entity, ct).ConfigureAwait(false);1040			if (entity.Columns["UID_ADSContainer"].IsDifferent && !entity.IsDeleted())1041			{1042				await ADSHelper.CheckContainerLimit(parameters.Session, entity, parameters.UnitOfWork, ct).ConfigureAwait(false);1043			}1044		}1045		return await base.OnSavingAsync(entity, parameters, ct).ConfigureAwait(false);1046	}10471048	[AsyncStateMachine(typeof(_003COnSavedAsync_003Ed__7))]1049	public override System.Threading.Tasks.Task OnSavedAsync(IEntity entity, LogicReadWriteParameters parameters, CancellationToken ct)1050	{1051		//IL_0002: Unknown result type (might be due to invalid IL or missing references)1052		//IL_0007: Unknown result type (might be due to invalid IL or missing references)1053		//IL_0026: Unknown result type (might be due to invalid IL or missing references)1054		//IL_0027: Unknown result type (might be due to invalid IL or missing references)1055		_003COnSavedAsync_003Ed__7 _003COnSavedAsync_003Ed__ = default(_003COnSavedAsync_003Ed__7);1056		_003COnSavedAsync_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();1057		_003COnSavedAsync_003Ed__._003C_003E4__this = this;1058		_003COnSavedAsync_003Ed__.entity = entity;1059		_003COnSavedAsync_003Ed__.parameters = parameters;1060		_003COnSavedAsync_003Ed__.ct = ct;1061		_003COnSavedAsync_003Ed__._003C_003E1__state = -1;1062		((AsyncTaskMethodBuilder)(ref _003COnSavedAsync_003Ed__._003C_003Et__builder)).Start<_003COnSavedAsync_003Ed__7>(ref _003COnSavedAsync_003Ed__);1063		return ((AsyncTaskMethodBuilder)(ref _003COnSavedAsync_003Ed__._003C_003Et__builder)).Task;1064	}10651066	[AsyncStateMachine(typeof(_003C_CheckGroupTypeChanging_003Ed__8))]1067	private static System.Threading.Tasks.Task _CheckGroupTypeChanging(ISession session, IEntity entity, CancellationToken ct)1068	{1069		//IL_0002: Unknown result type (might be due to invalid IL or missing references)1070		//IL_0007: Unknown result type (might be due to invalid IL or missing references)1071		//IL_001e: Unknown result type (might be due to invalid IL or missing references)1072		//IL_001f: Unknown result type (might be due to invalid IL or missing references)1073		_003C_CheckGroupTypeChanging_003Ed__8 _003C_CheckGroupTypeChanging_003Ed__ = default(_003C_CheckGroupTypeChanging_003Ed__8);1074		_003C_CheckGroupTypeChanging_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();1075		_003C_CheckGroupTypeChanging_003Ed__.session = session;1076		_003C_CheckGroupTypeChanging_003Ed__.entity = entity;1077		_003C_CheckGroupTypeChanging_003Ed__.ct = ct;1078		_003C_CheckGroupTypeChanging_003Ed__._003C_003E1__state = -1;1079		((AsyncTaskMethodBuilder)(ref _003C_CheckGroupTypeChanging_003Ed__._003C_003Et__builder)).Start<_003C_CheckGroupTypeChanging_003Ed__8>(ref _003C_CheckGroupTypeChanging_003Ed__);1080		return ((AsyncTaskMethodBuilder)(ref _003C_CheckGroupTypeChanging_003Ed__._003C_003Et__builder)).Task;1081	}10821083	[AsyncStateMachine(typeof(_003C_CheckGroupTypeChanged_003Ed__9))]1084	private static System.Threading.Tasks.Task _CheckGroupTypeChanged(ISession session, IEntity entity, IUnitOfWork uow, CancellationToken ct)1085	{1086		//IL_0002: Unknown result type (might be due to invalid IL or missing references)1087		//IL_0007: Unknown result type (might be due to invalid IL or missing references)1088		//IL_0026: Unknown result type (might be due to invalid IL or missing references)1089		//IL_0027: Unknown result type (might be due to invalid IL or missing references)1090		_003C_CheckGroupTypeChanged_003Ed__9 _003C_CheckGroupTypeChanged_003Ed__ = default(_003C_CheckGroupTypeChanged_003Ed__9);1091		_003C_CheckGroupTypeChanged_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();1092		_003C_CheckGroupTypeChanged_003Ed__.session = session;1093		_003C_CheckGroupTypeChanged_003Ed__.entity = entity;1094		_003C_CheckGroupTypeChanged_003Ed__.uow = uow;1095		_003C_CheckGroupTypeChanged_003Ed__.ct = ct;1096		_003C_CheckGroupTypeChanged_003Ed__._003C_003E1__state = -1;1097		((AsyncTaskMethodBuilder)(ref _003C_CheckGroupTypeChanged_003Ed__._003C_003Et__builder)).Start<_003C_CheckGroupTypeChanged_003Ed__9>(ref _003C_CheckGroupTypeChanged_003Ed__);1098		return ((AsyncTaskMethodBuilder)(ref _003C_CheckGroupTypeChanged_003Ed__._003C_003Et__builder)).Task;1099	}1100}1101