Back to OIM Explorer

POL.Customizer/POL.Customizer/QERPolicy.cs

Decompiler Source FilePOL.Customizer.QERPolicyDecompiled Source

8 extracted method/event/call references in QERPolicy.

Source: F:\Claude\.tmp\oim-decompiled-full\0953_One_Identity_Manager_POL.Customizer.dll\POL.Customizer\QERPolicy.cs

Source size: 84.435 characters

Interpretation

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

Relations

  • Method registration: RecalculatePolicy at line 1583
  • Method registration: RecalculateAll at line 1584
  • Function registration: CreateAttestations at line 1585
  • CallFunctionAsync: CreateAttestations at line 355
  • CallFunctionAsync: GetWhereClause at line 399
  • CallMethodAsync: MakeDecision at line 1500
  • CallFunctionAsync: GetWhereClause at line 1768
  • CallFunctionAsync: CreateAttestations at line 1782

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 QERPolicy, _003C_003Ec__DisplayClass11_0, _003C_003Ec__DisplayClass5_0; methods _003CCreateAttestations_003Eb__0, _003CCreateAttestations_003Eb__2, _003C_Check_UID_DialogTable_003Eb__0, MoveNext, SetStateMachine, OnSavingAsync; references AERole, AttestationObject, AttestationPolicy, ComplianceArea, DialogTable, MitigatingControl; markers reads entity values, references DB/Dialog objects

Classes

QERPolicy _003C_003Ec__DisplayClass11_0 _003C_003Ec__DisplayClass5_0

OIM key/entity markers

UID_QERPolicy UID_DialogTable ObjectKeyAttPolicy UID_AttestationObject ObjectKey XObjectKey UID_ComplianceArea UID_MitigatingControl UID_PersonDecisionMade UID_AERoleAttestator UID_AERoleRuler UID_AERoleResponsible UID_QERPolicyWork

API/entity calls

GetValue GetValueAsync TryResult CreateWalker Source From SqlFormatter MetaData IsDeleted Config FormatValue

Registrations / handlers

None extracted.

Complete Source

C#1.808 lines
1using System;2using System.Collections;3using System.Collections.Generic;4using System.Diagnostics;5using System.Linq;6using System.Runtime.CompilerServices;7using System.Runtime.InteropServices;8using System.Threading;9using System.Threading.Tasks;10using QER.Customizer;11using QER.Customizer.HelperClasses;12using VI.Base;13using VI.DB;14using VI.DB.DataAccess;15using VI.DB.Entities;16using VI.DB.MetaData;17using VI.DB.Sync;1819namespace POL.Customizer;2021public class QERPolicy : WorkingCopyEntityLogic<QERPolicyFlags>22{23	[CompilerGenerated]24	private sealed class _003C_003Ec__DisplayClass11_025	{26		public string uidQERPolicy;2728		public int iObjectKey;2930		internal ExpressionClause _003CCreateAttestations_003Eb__0(IExpressionContext c)31		{32			return c.Column("UID_QERPolicy") == uidQERPolicy;33		}3435		internal string _003CCreateAttestations_003Eb__2(IEntity e)36		{37			return e.Columns[iObjectKey].GetValue<string>();38		}39	}4041	[CompilerGenerated]42	private sealed class _003C_003Ec__DisplayClass5_043	{44		public string uidDialogTable;4546		internal ExpressionClause _003C_Check_UID_DialogTable_003Eb__0(IExpressionContext c)47		{48			return c.Column("UID_DialogTable") == uidDialogTable;49		}50	}5152	[StructLayout((LayoutKind)3)]53	[CompilerGenerated]54	private struct _003CCheckSameTable_003Ed__9 : IAsyncStateMachine55	{56		public int _003C_003E1__state;5758		public AsyncTaskMethodBuilder _003C_003Et__builder;5960		public IEntity entity;6162		public ISession session;6364		public CancellationToken ct;6566		private string _003CuidTableQERPolicy_003E5__2;6768		private ConfiguredValueTaskAwaiter<string> _003C_003Eu__1;6970		private void MoveNext()71		{72			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)73			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)74			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)75			//IL_0087: Unknown result type (might be due to invalid IL or missing references)76			//IL_0095: Unknown result type (might be due to invalid IL or missing references)77			//IL_009a: Unknown result type (might be due to invalid IL or missing references)78			//IL_009e: Unknown result type (might be due to invalid IL or missing references)79			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)80			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)81			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)82			int num = _003C_003E1__state;83			try84			{85				ConfiguredValueTaskAwaiter<string> val;86				if (num == 0)87				{88					val = _003C_003Eu__1;89					_003C_003Eu__1 = default(ConfiguredValueTaskAwaiter<string>);90					num = (_003C_003E1__state = -1);91					goto IL_00ec;92				}93				if (entity.IsLoaded && !entity.Columns.ChangedAny("UID_DialogTable", "ObjectKeyAttPolicy"))94				{95					_003CuidTableQERPolicy_003E5__2 = entity.GetValue<string>("UID_DialogTable");96					if (!string.IsNullOrEmpty(_003CuidTableQERPolicy_003E5__2))97					{98						val = entity.CreateWalker(session).GetValueAsync<string>("FK(ObjectKeyAttPolicy).FK(UID_AttestationObject).UID_DialogTable", ct).ConfigureAwait(false)99							.GetAwaiter();100						if (!val.IsCompleted)101						{102							num = (_003C_003E1__state = 0);103							_003C_003Eu__1 = val;104							((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<string>, _003CCheckSameTable_003Ed__9>(ref val, ref this);105							return;106						}107						goto IL_00ec;108					}109				}110				goto end_IL_0007;111				IL_00ec:112				string result = val.GetResult();113				if (!string.IsNullOrEmpty(result) && !string.Equals(_003CuidTableQERPolicy_003E5__2, result))114				{115					throw new ViException(2124382, ExceptionRelevance.EndUser);116				}117				end_IL_0007:;118			}119			catch (System.Exception exception)120			{121				_003C_003E1__state = -2;122				_003CuidTableQERPolicy_003E5__2 = null;123				((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);124				return;125			}126			_003C_003E1__state = -2;127			_003CuidTableQERPolicy_003E5__2 = null;128			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();129		}130131		[DebuggerHidden]132		private void SetStateMachine(IAsyncStateMachine stateMachine)133		{134			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);135		}136	}137138	[StructLayout((LayoutKind)3)]139	[CompilerGenerated]140	private struct _003CCreateAttestations_003Ed__11 : IAsyncStateMachine141	{142		public int _003C_003E1__state;143144		public AsyncTaskMethodBuilder<DbObjectKey[]> _003C_003Et__builder;145146		public ISession session;147148		public IEntity entity;149150		public CancellationToken ct;151152		private _003C_003Ec__DisplayClass11_0 _003C_003E8__1;153154		public bool bAll;155156		private ISelect _003CsPolicyHasObject_003E5__2;157158		private IEntityWalker _003CwEntity_003E5__3;159160		private IEntity _003CeAttestationPolicy_003E5__4;161162		private string _003CstrWhere_003E5__5;163164		private ConfiguredTaskAwaiter _003C_003Eu__1;165166		private ConfiguredTaskAwaiter<IEntity> _003C_003Eu__2;167168		private ConfiguredValueTaskAwaiter<object> _003C_003Eu__3;169170		private ConfiguredValueTaskAwaiter<string> _003C_003Eu__4;171172		private ConfiguredTaskAwaiter<IEntityCollection> _003C_003Eu__5;173174		private void MoveNext()175		{176			//IL_008a: Unknown result type (might be due to invalid IL or missing references)177			//IL_008f: Unknown result type (might be due to invalid IL or missing references)178			//IL_0097: Unknown result type (might be due to invalid IL or missing references)179			//IL_019d: Unknown result type (might be due to invalid IL or missing references)180			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)181			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)182			//IL_0246: Unknown result type (might be due to invalid IL or missing references)183			//IL_024b: Unknown result type (might be due to invalid IL or missing references)184			//IL_0253: Unknown result type (might be due to invalid IL or missing references)185			//IL_02d1: Unknown result type (might be due to invalid IL or missing references)186			//IL_02d6: Unknown result type (might be due to invalid IL or missing references)187			//IL_02de: Unknown result type (might be due to invalid IL or missing references)188			//IL_03af: Unknown result type (might be due to invalid IL or missing references)189			//IL_03b4: Unknown result type (might be due to invalid IL or missing references)190			//IL_03bc: Unknown result type (might be due to invalid IL or missing references)191			//IL_04b3: Unknown result type (might be due to invalid IL or missing references)192			//IL_04b8: Unknown result type (might be due to invalid IL or missing references)193			//IL_04c0: Unknown result type (might be due to invalid IL or missing references)194			//IL_056e: Unknown result type (might be due to invalid IL or missing references)195			//IL_0573: Unknown result type (might be due to invalid IL or missing references)196			//IL_057b: Unknown result type (might be due to invalid IL or missing references)197			//IL_0041: Unknown result type (might be due to invalid IL or missing references)198			//IL_004c: Unknown result type (might be due to invalid IL or missing references)199			//IL_0051: Unknown result type (might be due to invalid IL or missing references)200			//IL_0055: Unknown result type (might be due to invalid IL or missing references)201			//IL_005a: Unknown result type (might be due to invalid IL or missing references)202			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)203			//IL_0208: Unknown result type (might be due to invalid IL or missing references)204			//IL_020d: Unknown result type (might be due to invalid IL or missing references)205			//IL_0211: Unknown result type (might be due to invalid IL or missing references)206			//IL_0216: Unknown result type (might be due to invalid IL or missing references)207			//IL_0284: Unknown result type (might be due to invalid IL or missing references)208			//IL_0293: Unknown result type (might be due to invalid IL or missing references)209			//IL_0298: Unknown result type (might be due to invalid IL or missing references)210			//IL_029c: Unknown result type (might be due to invalid IL or missing references)211			//IL_02a1: Unknown result type (might be due to invalid IL or missing references)212			//IL_0366: Unknown result type (might be due to invalid IL or missing references)213			//IL_0371: Unknown result type (might be due to invalid IL or missing references)214			//IL_0376: Unknown result type (might be due to invalid IL or missing references)215			//IL_037a: Unknown result type (might be due to invalid IL or missing references)216			//IL_037f: Unknown result type (might be due to invalid IL or missing references)217			//IL_0521: Unknown result type (might be due to invalid IL or missing references)218			//IL_0530: Unknown result type (might be due to invalid IL or missing references)219			//IL_0535: Unknown result type (might be due to invalid IL or missing references)220			//IL_0539: Unknown result type (might be due to invalid IL or missing references)221			//IL_053e: Unknown result type (might be due to invalid IL or missing references)222			//IL_006f: Unknown result type (might be due to invalid IL or missing references)223			//IL_0071: Unknown result type (might be due to invalid IL or missing references)224			//IL_0154: Unknown result type (might be due to invalid IL or missing references)225			//IL_015f: Unknown result type (might be due to invalid IL or missing references)226			//IL_0164: Unknown result type (might be due to invalid IL or missing references)227			//IL_0168: Unknown result type (might be due to invalid IL or missing references)228			//IL_016d: Unknown result type (might be due to invalid IL or missing references)229			//IL_022b: Unknown result type (might be due to invalid IL or missing references)230			//IL_022d: Unknown result type (might be due to invalid IL or missing references)231			//IL_02b6: Unknown result type (might be due to invalid IL or missing references)232			//IL_02b8: Unknown result type (might be due to invalid IL or missing references)233			//IL_0394: Unknown result type (might be due to invalid IL or missing references)234			//IL_0396: Unknown result type (might be due to invalid IL or missing references)235			//IL_046a: Unknown result type (might be due to invalid IL or missing references)236			//IL_0475: Unknown result type (might be due to invalid IL or missing references)237			//IL_047a: Unknown result type (might be due to invalid IL or missing references)238			//IL_047e: Unknown result type (might be due to invalid IL or missing references)239			//IL_0483: Unknown result type (might be due to invalid IL or missing references)240			//IL_0553: Unknown result type (might be due to invalid IL or missing references)241			//IL_0555: Unknown result type (might be due to invalid IL or missing references)242			//IL_0182: Unknown result type (might be due to invalid IL or missing references)243			//IL_0184: Unknown result type (might be due to invalid IL or missing references)244			//IL_0498: Unknown result type (might be due to invalid IL or missing references)245			//IL_049a: Unknown result type (might be due to invalid IL or missing references)246			int num = _003C_003E1__state;247			DbObjectKey[] result6;248			try249			{250				ConfiguredTaskAwaiter val5;251				ConfiguredTaskAwaiter<IEntity> val4;252				ConfiguredValueTaskAwaiter<string> val3;253				ConfiguredTaskAwaiter<IEntityCollection> val2;254				ConfiguredValueTaskAwaiter<object> val;255				string result;256				string whereClause;257				Query query;258				IEntityCollection result2;259				string[] parameter;260				IEntityCollection result3;261				Query query2;262				object result4;263				IEntity result5;264				switch (num)265				{266				default:267				{268					_003C_003E8__1 = new _003C_003Ec__DisplayClass11_0();269					ConfiguredTaskAwaitable val6 = CheckSameTable(session, entity, ct).ConfigureAwait(false);270					val5 = ((ConfiguredTaskAwaitable)(ref val6)).GetAwaiter();271					if (!((ConfiguredTaskAwaiter)(ref val5)).IsCompleted)272					{273						num = (_003C_003E1__state = 0);274						_003C_003Eu__1 = val5;275						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003CCreateAttestations_003Ed__11>(ref val5, ref this);276						return;277					}278					goto IL_00a6;279				}280				case 0:281					val5 = _003C_003Eu__1;282					_003C_003Eu__1 = default(ConfiguredTaskAwaiter);283					num = (_003C_003E1__state = -1);284					goto IL_00a6;285				case 1:286					val4 = _003C_003Eu__2;287					_003C_003Eu__2 = default(ConfiguredTaskAwaiter<IEntity>);288					num = (_003C_003E1__state = -1);289					goto IL_01b9;290				case 2:291					val = _003C_003Eu__3;292					_003C_003Eu__3 = default(ConfiguredValueTaskAwaiter<object>);293					num = (_003C_003E1__state = -1);294					goto IL_0262;295				case 3:296					val3 = _003C_003Eu__4;297					_003C_003Eu__4 = default(ConfiguredValueTaskAwaiter<string>);298					num = (_003C_003E1__state = -1);299					goto IL_02ed;300				case 4:301					val2 = _003C_003Eu__5;302					_003C_003Eu__5 = default(ConfiguredTaskAwaiter<IEntityCollection>);303					num = (_003C_003E1__state = -1);304					goto IL_03cb;305				case 5:306					val2 = _003C_003Eu__5;307					_003C_003Eu__5 = default(ConfiguredTaskAwaiter<IEntityCollection>);308					num = (_003C_003E1__state = -1);309					goto IL_04cf;310				case 6:311					{312						val = _003C_003Eu__3;313						_003C_003Eu__3 = default(ConfiguredValueTaskAwaiter<object>);314						num = (_003C_003E1__state = -1);315						break;316					}317					IL_02ed:318					result = val3.GetResult();319					whereClause = $"ObjectKey not in (select XObjectKey from {result} where {_003CstrWhere_003E5__5})";320					query = _003CsPolicyHasObject_003E5__2.Where(whereClause).SelectDisplays();321					val2 = session.Source().GetCollectionAsync(query, EntityCollectionLoadType.ForeignDisplaysForAllColumns, ct).ConfigureAwait(false)322						.GetAwaiter();323					if (!val2.IsCompleted)324					{325						num = (_003C_003E1__state = 4);326						_003C_003Eu__5 = val2;327						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntityCollection>, _003CCreateAttestations_003Ed__11>(ref val2, ref this);328						return;329					}330					goto IL_03cb;331					IL_00a6:332					((ConfiguredTaskAwaiter)(ref val5)).GetResult();333					_003C_003E8__1.uidQERPolicy = entity.Columns["UID_QERPolicy"].GetValue<string>();334					_003CsPolicyHasObject_003E5__2 = from c in Query.From("QERPolicyHasObject")335						where c.Column("UID_QERPolicy") == _003C_003E8__1.uidQERPolicy336						select c;337					if (!bAll)338					{339						_003CsPolicyHasObject_003E5__2 = _003CsPolicyHasObject_003E5__2.Where((IExpressionContext c) => c.Column("IsDecisionMade") == false);340					}341					_003CwEntity_003E5__3 = entity.CreateWalker(session);342					val4 = _003CwEntity_003E5__3.GetEntityAsync("FK(ObjectKeyAttPolicy)", ct).ConfigureAwait(false).GetAwaiter();343					if (!val4.IsCompleted)344					{345						num = (_003C_003E1__state = 1);346						_003C_003Eu__2 = val4;347						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntity>, _003CCreateAttestations_003Ed__11>(ref val4, ref this);348						return;349					}350					goto IL_01b9;351					IL_04cf:352					result2 = val2.GetResult();353					_003C_003E8__1.iObjectKey = result2.ColumnIndices["ObjectKey"];354					parameter = Enumerable.ToArray<string>(Enumerable.Select<IEntity, string>((System.Collections.Generic.IEnumerable<IEntity>)result2, (Func<IEntity, string>)((IEntity e) => e.Columns[_003C_003E8__1.iObjectKey].GetValue<string>())));355					val = _003CeAttestationPolicy_003E5__4.CallFunctionAsync("CreateAttestations", parameter, ct).ConfigureAwait(false).GetAwaiter();356					if (!val.IsCompleted)357					{358						num = (_003C_003E1__state = 6);359						_003C_003Eu__3 = val;360						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<object>, _003CCreateAttestations_003Ed__11>(ref val, ref this);361						return;362					}363					break;364					IL_03cb:365					result3 = val2.GetResult();366					if (((System.Collections.Generic.IReadOnlyCollection<IEntity>)result3).Count > 0)367					{368						string text = string.Join(", ", Enumerable.Select<IEntity, string>(Enumerable.Take<IEntity>((System.Collections.Generic.IEnumerable<IEntity>)result3, 3), (Func<IEntity, string>)((IEntity e) => e.Display)));369						throw new ViException(2124383, ExceptionRelevance.EndUser, ((System.Collections.Generic.IReadOnlyCollection<IEntity>)result3).Count, text);370					}371					query2 = _003CsPolicyHasObject_003E5__2.Select("ObjectKey");372					val2 = session.Source().GetCollectionAsync(query2, EntityCollectionLoadType.Slim, ct).ConfigureAwait(false)373						.GetAwaiter();374					if (!val2.IsCompleted)375					{376						num = (_003C_003E1__state = 5);377						_003C_003Eu__5 = val2;378						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntityCollection>, _003CCreateAttestations_003Ed__11>(ref val2, ref this);379						return;380					}381					goto IL_04cf;382					IL_0262:383					result4 = val.GetResult();384					_003CstrWhere_003E5__5 = (string)result4;385					val3 = _003CwEntity_003E5__3.GetValueAsync<string>("FK(UID_DialogTable).TableName", ct).ConfigureAwait(false).GetAwaiter();386					if (!val3.IsCompleted)387					{388						num = (_003C_003E1__state = 3);389						_003C_003Eu__4 = val3;390						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<string>, _003CCreateAttestations_003Ed__11>(ref val3, ref this);391						return;392					}393					goto IL_02ed;394					IL_01b9:395					result5 = val4.GetResult();396					_003CeAttestationPolicy_003E5__4 = result5;397					_003CeAttestationPolicy_003E5__4 = _003CeAttestationPolicy_003E5__4.CreateInteractive(session);398					session.SqlFormatter();399					val = _003CeAttestationPolicy_003E5__4.CallFunctionAsync("GetWhereClause", ct).ConfigureAwait(false).GetAwaiter();400					if (!val.IsCompleted)401					{402						num = (_003C_003E1__state = 2);403						_003C_003Eu__3 = val;404						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<object>, _003CCreateAttestations_003Ed__11>(ref val, ref this);405						return;406					}407					goto IL_0262;408				}409				result6 = (DbObjectKey[])val.GetResult();410			}411			catch (System.Exception exception)412			{413				_003C_003E1__state = -2;414				_003C_003E8__1 = null;415				_003CsPolicyHasObject_003E5__2 = null;416				_003CwEntity_003E5__3 = null;417				_003CeAttestationPolicy_003E5__4 = null;418				_003CstrWhere_003E5__5 = null;419				_003C_003Et__builder.SetException(exception);420				return;421			}422			_003C_003E1__state = -2;423			_003C_003E8__1 = null;424			_003CsPolicyHasObject_003E5__2 = null;425			_003CwEntity_003E5__3 = null;426			_003CeAttestationPolicy_003E5__4 = null;427			_003CstrWhere_003E5__5 = null;428			_003C_003Et__builder.SetResult(result6);429		}430431		[DebuggerHidden]432		private void SetStateMachine(IAsyncStateMachine stateMachine)433		{434			_003C_003Et__builder.SetStateMachine(stateMachine);435		}436	}437438	[StructLayout((LayoutKind)3)]439	[CompilerGenerated]440	private struct _003COnActiveCopySaved_003Ed__8 : IAsyncStateMachine441	{442		public int _003C_003E1__state;443444		public AsyncTaskMethodBuilder _003C_003Et__builder;445446		public LogicParameter lp;447448		public QERPolicy _003C_003E4__this;449450		public IEntity eActive;451452		private IMetaTableRelations _003CmRels_003E5__2;453454		private ConfiguredTaskAwaiter<IMetaTable> _003C_003Eu__1;455456		private ConfiguredTaskAwaiter<IMetaTableRelations> _003C_003Eu__2;457458		private ConfiguredTaskAwaiter _003C_003Eu__3;459460		private void MoveNext()461		{462			//IL_008b: Unknown result type (might be due to invalid IL or missing references)463			//IL_0090: Unknown result type (might be due to invalid IL or missing references)464			//IL_0098: Unknown result type (might be due to invalid IL or missing references)465			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)466			//IL_0102: Unknown result type (might be due to invalid IL or missing references)467			//IL_010a: Unknown result type (might be due to invalid IL or missing references)468			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)469			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)470			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)471			//IL_0273: Unknown result type (might be due to invalid IL or missing references)472			//IL_0278: Unknown result type (might be due to invalid IL or missing references)473			//IL_0280: Unknown result type (might be due to invalid IL or missing references)474			//IL_02e4: Unknown result type (might be due to invalid IL or missing references)475			//IL_02e9: Unknown result type (might be due to invalid IL or missing references)476			//IL_02f1: Unknown result type (might be due to invalid IL or missing references)477			//IL_003f: Unknown result type (might be due to invalid IL or missing references)478			//IL_0045: Unknown result type (might be due to invalid IL or missing references)479			//IL_004d: Unknown result type (might be due to invalid IL or missing references)480			//IL_0052: Unknown result type (might be due to invalid IL or missing references)481			//IL_0056: Unknown result type (might be due to invalid IL or missing references)482			//IL_005b: Unknown result type (might be due to invalid IL or missing references)483			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)484			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)485			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)486			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)487			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)488			//IL_0070: Unknown result type (might be due to invalid IL or missing references)489			//IL_0072: Unknown result type (might be due to invalid IL or missing references)490			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)491			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)492			//IL_02a9: Unknown result type (might be due to invalid IL or missing references)493			//IL_02ae: Unknown result type (might be due to invalid IL or missing references)494			//IL_02b2: Unknown result type (might be due to invalid IL or missing references)495			//IL_02b7: Unknown result type (might be due to invalid IL or missing references)496			//IL_017f: Unknown result type (might be due to invalid IL or missing references)497			//IL_0184: Unknown result type (might be due to invalid IL or missing references)498			//IL_0188: Unknown result type (might be due to invalid IL or missing references)499			//IL_018d: Unknown result type (might be due to invalid IL or missing references)500			//IL_02cc: Unknown result type (might be due to invalid IL or missing references)501			//IL_02ce: Unknown result type (might be due to invalid IL or missing references)502			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)503			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)504			//IL_0235: Unknown result type (might be due to invalid IL or missing references)505			//IL_023a: Unknown result type (might be due to invalid IL or missing references)506			//IL_023e: Unknown result type (might be due to invalid IL or missing references)507			//IL_0243: Unknown result type (might be due to invalid IL or missing references)508			//IL_0258: Unknown result type (might be due to invalid IL or missing references)509			//IL_025a: Unknown result type (might be due to invalid IL or missing references)510			int num = _003C_003E1__state;511			QERPolicy qERPolicy = _003C_003E4__this;512			try513			{514				ConfiguredTaskAwaiter<IMetaTable> val3;515				ConfiguredTaskAwaiter<IMetaTableRelations> val2;516				ConfiguredTaskAwaiter val;517				ConfiguredTaskAwaitable val4;518				IMetaTableRelations result;519				IMetaTableRelation metaTableRelation;520				IMetaTableRelation metaTableRelation2;521				switch (num)522				{523				default:524					val3 = lp.Session.MetaData().GetTableAsync("QERPolicy").ConfigureAwait(false)525						.GetAwaiter();526					if (!val3.IsCompleted)527					{528						num = (_003C_003E1__state = 0);529						_003C_003Eu__1 = val3;530						((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IMetaTable>, _003COnActiveCopySaved_003Ed__8>(ref val3, ref this);531						return;532					}533					goto IL_00a7;534				case 0:535					val3 = _003C_003Eu__1;536					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<IMetaTable>);537					num = (_003C_003E1__state = -1);538					goto IL_00a7;539				case 1:540					val2 = _003C_003Eu__2;541					_003C_003Eu__2 = default(ConfiguredTaskAwaiter<IMetaTableRelations>);542					num = (_003C_003E1__state = -1);543					goto IL_0119;544				case 2:545					val = _003C_003Eu__3;546					_003C_003Eu__3 = default(ConfiguredTaskAwaiter);547					num = (_003C_003E1__state = -1);548					goto IL_01d9;549				case 3:550					val = _003C_003Eu__3;551					_003C_003Eu__3 = default(ConfiguredTaskAwaiter);552					num = (_003C_003E1__state = -1);553					goto IL_028f;554				case 4:555					{556						val = _003C_003Eu__3;557						_003C_003Eu__3 = default(ConfiguredTaskAwaiter);558						num = (_003C_003E1__state = -1);559						break;560					}561					IL_0296:562					val4 = ((WorkingCopyEntityLogic<QERPolicyFlags>)qERPolicy).OnActiveCopySaved(eActive, lp).ConfigureAwait(false);563					val = ((ConfiguredTaskAwaitable)(ref val4)).GetAwaiter();564					if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)565					{566						num = (_003C_003E1__state = 4);567						_003C_003Eu__3 = val;568						((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnActiveCopySaved_003Ed__8>(ref val, ref this);569						return;570					}571					break;572					IL_00a7:573					val2 = val3.GetResult().GetChildRelationsAsync(lp.CancellationToken).ConfigureAwait(false)574						.GetAwaiter();575					if (!val2.IsCompleted)576					{577						num = (_003C_003E1__state = 1);578						_003C_003Eu__2 = val2;579						((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IMetaTableRelations>, _003COnActiveCopySaved_003Ed__8>(ref val2, ref this);580						return;581					}582					goto IL_0119;583					IL_028f:584					((ConfiguredTaskAwaiter)(ref val)).GetResult();585					goto IL_0296;586					IL_0119:587					result = val2.GetResult();588					_003CmRels_003E5__2 = result;589					metaTableRelation = Enumerable.FirstOrDefault<IMetaTableRelation>((System.Collections.Generic.IEnumerable<IMetaTableRelation>)_003CmRels_003E5__2, (Func<IMetaTableRelation, bool>)((IMetaTableRelation r) => r.ChildTableName == "QERPolicyInArea"));590					if (metaTableRelation != null)591					{592						val4 = qERPolicy.CopyMN(metaTableRelation, "UID_ComplianceArea", lp.Entity, eActive, lp).ConfigureAwait(false);593						val = ((ConfiguredTaskAwaitable)(ref val4)).GetAwaiter();594						if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)595						{596							num = (_003C_003E1__state = 2);597							_003C_003Eu__3 = val;598							((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnActiveCopySaved_003Ed__8>(ref val, ref this);599							return;600						}601						goto IL_01d9;602					}603					goto IL_01e0;604					IL_01e0:605					metaTableRelation2 = Enumerable.FirstOrDefault<IMetaTableRelation>((System.Collections.Generic.IEnumerable<IMetaTableRelation>)_003CmRels_003E5__2, (Func<IMetaTableRelation, bool>)((IMetaTableRelation r) => r.ChildTableName == "QERPolicyHasMControl"));606					if (metaTableRelation2 != null)607					{608						val4 = qERPolicy.CopyMN(metaTableRelation2, "UID_MitigatingControl", lp.Entity, eActive, lp).ConfigureAwait(false);609						val = ((ConfiguredTaskAwaitable)(ref val4)).GetAwaiter();610						if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)611						{612							num = (_003C_003E1__state = 3);613							_003C_003Eu__3 = val;614							((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnActiveCopySaved_003Ed__8>(ref val, ref this);615							return;616						}617						goto IL_028f;618					}619					goto IL_0296;620					IL_01d9:621					((ConfiguredTaskAwaiter)(ref val)).GetResult();622					goto IL_01e0;623				}624				((ConfiguredTaskAwaiter)(ref val)).GetResult();625			}626			catch (System.Exception exception)627			{628				_003C_003E1__state = -2;629				_003CmRels_003E5__2 = null;630				((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);631				return;632			}633			_003C_003E1__state = -2;634			_003CmRels_003E5__2 = null;635			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();636		}637638		[DebuggerHidden]639		private void SetStateMachine(IAsyncStateMachine stateMachine)640		{641			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);642		}643	}644645	[StructLayout((LayoutKind)3)]646	[CompilerGenerated]647	private struct _003COnSavingAsync_003Ed__2 : IAsyncStateMachine648	{649		public int _003C_003E1__state;650651		public AsyncTaskMethodBuilder<Diff> _003C_003Et__builder;652653		public IEntity entity;654655		public LogicReadWriteParameters parameters;656657		public CancellationToken cancellationToken;658659		public QERPolicy _003C_003E4__this;660661		private LogicParameter _003Clp_003E5__2;662663		private ConfiguredTaskAwaiter _003C_003Eu__1;664665		private ConfiguredTaskAwaiter<bool> _003C_003Eu__2;666667		private ConfiguredTaskAwaiter<Diff> _003C_003Eu__3;668669		private void MoveNext()670		{671			//IL_009f: Unknown result type (might be due to invalid IL or missing references)672			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)673			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)674			//IL_0139: Unknown result type (might be due to invalid IL or missing references)675			//IL_013e: Unknown result type (might be due to invalid IL or missing references)676			//IL_0145: Unknown result type (might be due to invalid IL or missing references)677			//IL_01d1: Unknown result type (might be due to invalid IL or missing references)678			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)679			//IL_01de: Unknown result type (might be due to invalid IL or missing references)680			//IL_0253: Unknown result type (might be due to invalid IL or missing references)681			//IL_0258: Unknown result type (might be due to invalid IL or missing references)682			//IL_025f: Unknown result type (might be due to invalid IL or missing references)683			//IL_02c9: Unknown result type (might be due to invalid IL or missing references)684			//IL_02ce: Unknown result type (might be due to invalid IL or missing references)685			//IL_02d6: Unknown result type (might be due to invalid IL or missing references)686			//IL_0036: Unknown result type (might be due to invalid IL or missing references)687			//IL_0063: Unknown result type (might be due to invalid IL or missing references)688			//IL_0068: Unknown result type (might be due to invalid IL or missing references)689			//IL_006c: Unknown result type (might be due to invalid IL or missing references)690			//IL_0071: Unknown result type (might be due to invalid IL or missing references)691			//IL_0283: Unknown result type (might be due to invalid IL or missing references)692			//IL_028e: Unknown result type (might be due to invalid IL or missing references)693			//IL_0293: Unknown result type (might be due to invalid IL or missing references)694			//IL_0297: Unknown result type (might be due to invalid IL or missing references)695			//IL_029c: Unknown result type (might be due to invalid IL or missing references)696			//IL_0085: Unknown result type (might be due to invalid IL or missing references)697			//IL_0086: Unknown result type (might be due to invalid IL or missing references)698			//IL_0188: Unknown result type (might be due to invalid IL or missing references)699			//IL_0193: Unknown result type (might be due to invalid IL or missing references)700			//IL_0198: Unknown result type (might be due to invalid IL or missing references)701			//IL_019c: Unknown result type (might be due to invalid IL or missing references)702			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)703			//IL_020c: Unknown result type (might be due to invalid IL or missing references)704			//IL_0217: Unknown result type (might be due to invalid IL or missing references)705			//IL_021c: Unknown result type (might be due to invalid IL or missing references)706			//IL_0220: Unknown result type (might be due to invalid IL or missing references)707			//IL_0225: Unknown result type (might be due to invalid IL or missing references)708			//IL_02b1: Unknown result type (might be due to invalid IL or missing references)709			//IL_02b3: Unknown result type (might be due to invalid IL or missing references)710			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)711			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)712			//IL_0239: Unknown result type (might be due to invalid IL or missing references)713			//IL_023a: Unknown result type (might be due to invalid IL or missing references)714			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)715			//IL_0102: Unknown result type (might be due to invalid IL or missing references)716			//IL_0106: Unknown result type (might be due to invalid IL or missing references)717			//IL_010b: Unknown result type (might be due to invalid IL or missing references)718			//IL_011f: Unknown result type (might be due to invalid IL or missing references)719			//IL_0120: Unknown result type (might be due to invalid IL or missing references)720			int num = _003C_003E1__state;721			QERPolicy qERPolicy = _003C_003E4__this;722			Diff result;723			try724			{725				ConfiguredTaskAwaitable val4;726				ConfiguredTaskAwaiter val2;727				ConfiguredTaskAwaiter<bool> val3;728				ConfiguredTaskAwaiter<Diff> val;729				bool flag;730				switch (num)731				{732				default:733					_003Clp_003E5__2 = new LogicParameter(entity, parameters, cancellationToken);734					if (entity.GetValue<bool>("IsWorkingCopy"))735					{736						val4 = _Check_WhereClause(_003Clp_003E5__2).ConfigureAwait(false);737						val2 = ((ConfiguredTaskAwaitable)(ref val4)).GetAwaiter();738						if (!((ConfiguredTaskAwaiter)(ref val2)).IsCompleted)739						{740							num = (_003C_003E1__state = 0);741							_003C_003Eu__1 = val2;742							_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnSavingAsync_003Ed__2>(ref val2, ref this);743							return;744						}745						goto IL_00ba;746					}747					goto IL_00c1;748				case 0:749					val2 = _003C_003Eu__1;750					_003C_003Eu__1 = default(ConfiguredTaskAwaiter);751					num = (_003C_003E1__state = -1);752					goto IL_00ba;753				case 1:754					val2 = _003C_003Eu__1;755					_003C_003Eu__1 = default(ConfiguredTaskAwaiter);756					num = (_003C_003E1__state = -1);757					goto IL_0154;758				case 2:759					val3 = _003C_003Eu__2;760					_003C_003Eu__2 = default(ConfiguredTaskAwaiter<bool>);761					num = (_003C_003E1__state = -1);762					goto IL_01ed;763				case 3:764					val2 = _003C_003Eu__1;765					_003C_003Eu__1 = default(ConfiguredTaskAwaiter);766					num = (_003C_003E1__state = -1);767					goto IL_026e;768				case 4:769					{770						val = _003C_003Eu__3;771						_003C_003Eu__3 = default(ConfiguredTaskAwaiter<Diff>);772						num = (_003C_003E1__state = -1);773						break;774					}775					IL_0154:776					((ConfiguredTaskAwaiter)(ref val2)).GetResult();777					goto IL_015b;778					IL_015b:779					flag = !entity.IsDeleted();780					if (flag)781					{782						val3 = _003Clp_003E5__2.Session.Config().IsPreprocessorEnabledAsync("ATTESTATION", cancellationToken).ConfigureAwait(false)783							.GetAwaiter();784						if (!val3.IsCompleted)785						{786							num = (_003C_003E1__state = 2);787							_003C_003Eu__2 = val3;788							_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<bool>, _003COnSavingAsync_003Ed__2>(ref val3, ref this);789							return;790						}791						goto IL_01ed;792					}793					goto IL_01f6;794					IL_00ba:795					((ConfiguredTaskAwaiter)(ref val2)).GetResult();796					goto IL_00c1;797					IL_00c1:798					if (!entity.IsDeleted() && entity.IsLoaded && !entity.GetValue<bool>("IsWorkingCopy"))799					{800						val4 = qERPolicy._Handle_QERPolicyHasObject(_003Clp_003E5__2).ConfigureAwait(false);801						val2 = ((ConfiguredTaskAwaitable)(ref val4)).GetAwaiter();802						if (!((ConfiguredTaskAwaiter)(ref val2)).IsCompleted)803						{804							num = (_003C_003E1__state = 1);805							_003C_003Eu__1 = val2;806							_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnSavingAsync_003Ed__2>(ref val2, ref this);807							return;808						}809						goto IL_0154;810					}811					goto IL_015b;812					IL_026e:813					((ConfiguredTaskAwaiter)(ref val2)).GetResult();814					goto IL_0275;815					IL_0275:816					val = ((StateBasedEntityLogic)qERPolicy).OnSavingAsync(entity, parameters, cancellationToken).ConfigureAwait(false).GetAwaiter();817					if (!val.IsCompleted)818					{819						num = (_003C_003E1__state = 4);820						_003C_003Eu__3 = val;821						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<Diff>, _003COnSavingAsync_003Ed__2>(ref val, ref this);822						return;823					}824					break;825					IL_01ed:826					flag = val3.GetResult();827					goto IL_01f6;828					IL_01f6:829					if (flag)830					{831						val4 = CheckSameTable(parameters.Session, entity, cancellationToken).ConfigureAwait(false);832						val2 = ((ConfiguredTaskAwaitable)(ref val4)).GetAwaiter();833						if (!((ConfiguredTaskAwaiter)(ref val2)).IsCompleted)834						{835							num = (_003C_003E1__state = 3);836							_003C_003Eu__1 = val2;837							_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnSavingAsync_003Ed__2>(ref val2, ref this);838							return;839						}840						goto IL_026e;841					}842					goto IL_0275;843				}844				result = val.GetResult();845			}846			catch (System.Exception exception)847			{848				_003C_003E1__state = -2;849				_003Clp_003E5__2 = null;850				_003C_003Et__builder.SetException(exception);851				return;852			}853			_003C_003E1__state = -2;854			_003Clp_003E5__2 = null;855			_003C_003Et__builder.SetResult(result);856		}857858		[DebuggerHidden]859		private void SetStateMachine(IAsyncStateMachine stateMachine)860		{861			_003C_003Et__builder.SetStateMachine(stateMachine);862		}863	}864865	[StructLayout((LayoutKind)3)]866	[CompilerGenerated]867	private struct _003COnWorkingCopySaved_003Ed__7 : IAsyncStateMachine868	{869		public int _003C_003E1__state;870871		public AsyncTaskMethodBuilder _003C_003Et__builder;872873		public LogicParameter lp;874875		public QERPolicy _003C_003E4__this;876877		public IEntity eCopy;878879		private IMetaTableRelations _003CmRels_003E5__2;880881		private ConfiguredTaskAwaiter<IMetaTable> _003C_003Eu__1;882883		private ConfiguredTaskAwaiter<IMetaTableRelations> _003C_003Eu__2;884885		private ConfiguredTaskAwaiter _003C_003Eu__3;886887		private void MoveNext()888		{889			//IL_008b: Unknown result type (might be due to invalid IL or missing references)890			//IL_0090: Unknown result type (might be due to invalid IL or missing references)891			//IL_0098: Unknown result type (might be due to invalid IL or missing references)892			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)893			//IL_0102: Unknown result type (might be due to invalid IL or missing references)894			//IL_010a: Unknown result type (might be due to invalid IL or missing references)895			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)896			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)897			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)898			//IL_0273: Unknown result type (might be due to invalid IL or missing references)899			//IL_0278: Unknown result type (might be due to invalid IL or missing references)900			//IL_0280: Unknown result type (might be due to invalid IL or missing references)901			//IL_02e4: Unknown result type (might be due to invalid IL or missing references)902			//IL_02e9: Unknown result type (might be due to invalid IL or missing references)903			//IL_02f1: Unknown result type (might be due to invalid IL or missing references)904			//IL_003f: Unknown result type (might be due to invalid IL or missing references)905			//IL_0045: Unknown result type (might be due to invalid IL or missing references)906			//IL_004d: Unknown result type (might be due to invalid IL or missing references)907			//IL_0052: Unknown result type (might be due to invalid IL or missing references)908			//IL_0056: Unknown result type (might be due to invalid IL or missing references)909			//IL_005b: Unknown result type (might be due to invalid IL or missing references)910			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)911			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)912			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)913			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)914			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)915			//IL_0070: Unknown result type (might be due to invalid IL or missing references)916			//IL_0072: Unknown result type (might be due to invalid IL or missing references)917			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)918			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)919			//IL_02a9: Unknown result type (might be due to invalid IL or missing references)920			//IL_02ae: Unknown result type (might be due to invalid IL or missing references)921			//IL_02b2: Unknown result type (might be due to invalid IL or missing references)922			//IL_02b7: Unknown result type (might be due to invalid IL or missing references)923			//IL_017f: Unknown result type (might be due to invalid IL or missing references)924			//IL_0184: Unknown result type (might be due to invalid IL or missing references)925			//IL_0188: Unknown result type (might be due to invalid IL or missing references)926			//IL_018d: Unknown result type (might be due to invalid IL or missing references)927			//IL_02cc: Unknown result type (might be due to invalid IL or missing references)928			//IL_02ce: Unknown result type (might be due to invalid IL or missing references)929			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)930			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)931			//IL_0235: Unknown result type (might be due to invalid IL or missing references)932			//IL_023a: Unknown result type (might be due to invalid IL or missing references)933			//IL_023e: Unknown result type (might be due to invalid IL or missing references)934			//IL_0243: Unknown result type (might be due to invalid IL or missing references)935			//IL_0258: Unknown result type (might be due to invalid IL or missing references)936			//IL_025a: Unknown result type (might be due to invalid IL or missing references)937			int num = _003C_003E1__state;938			QERPolicy qERPolicy = _003C_003E4__this;939			try940			{941				ConfiguredTaskAwaiter<IMetaTable> val3;942				ConfiguredTaskAwaiter<IMetaTableRelations> val2;943				ConfiguredTaskAwaiter val;944				ConfiguredTaskAwaitable val4;945				IMetaTableRelations result;946				IMetaTableRelation metaTableRelation;947				IMetaTableRelation metaTableRelation2;948				switch (num)949				{950				default:951					val3 = lp.Session.MetaData().GetTableAsync("QERPolicy").ConfigureAwait(false)952						.GetAwaiter();953					if (!val3.IsCompleted)954					{955						num = (_003C_003E1__state = 0);956						_003C_003Eu__1 = val3;957						((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IMetaTable>, _003COnWorkingCopySaved_003Ed__7>(ref val3, ref this);958						return;959					}960					goto IL_00a7;961				case 0:962					val3 = _003C_003Eu__1;963					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<IMetaTable>);964					num = (_003C_003E1__state = -1);965					goto IL_00a7;966				case 1:967					val2 = _003C_003Eu__2;968					_003C_003Eu__2 = default(ConfiguredTaskAwaiter<IMetaTableRelations>);969					num = (_003C_003E1__state = -1);970					goto IL_0119;971				case 2:972					val = _003C_003Eu__3;973					_003C_003Eu__3 = default(ConfiguredTaskAwaiter);974					num = (_003C_003E1__state = -1);975					goto IL_01d9;976				case 3:977					val = _003C_003Eu__3;978					_003C_003Eu__3 = default(ConfiguredTaskAwaiter);979					num = (_003C_003E1__state = -1);980					goto IL_028f;981				case 4:982					{983						val = _003C_003Eu__3;984						_003C_003Eu__3 = default(ConfiguredTaskAwaiter);985						num = (_003C_003E1__state = -1);986						break;987					}988					IL_0296:989					val4 = ((WorkingCopyEntityLogic<QERPolicyFlags>)qERPolicy).OnWorkingCopySaved(eCopy, lp).ConfigureAwait(false);990					val = ((ConfiguredTaskAwaitable)(ref val4)).GetAwaiter();991					if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)992					{993						num = (_003C_003E1__state = 4);994						_003C_003Eu__3 = val;995						((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnWorkingCopySaved_003Ed__7>(ref val, ref this);996						return;997					}998					break;999					IL_00a7:1000					val2 = val3.GetResult().GetChildRelationsAsync(lp.CancellationToken).ConfigureAwait(false)1001						.GetAwaiter();1002					if (!val2.IsCompleted)1003					{1004						num = (_003C_003E1__state = 1);1005						_003C_003Eu__2 = val2;1006						((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IMetaTableRelations>, _003COnWorkingCopySaved_003Ed__7>(ref val2, ref this);1007						return;1008					}1009					goto IL_0119;1010					IL_028f:1011					((ConfiguredTaskAwaiter)(ref val)).GetResult();1012					goto IL_0296;1013					IL_0119:1014					result = val2.GetResult();1015					_003CmRels_003E5__2 = result;1016					metaTableRelation = Enumerable.FirstOrDefault<IMetaTableRelation>((System.Collections.Generic.IEnumerable<IMetaTableRelation>)_003CmRels_003E5__2, (Func<IMetaTableRelation, bool>)((IMetaTableRelation r) => r.ChildTableName == "QERPolicyInArea"));1017					if (metaTableRelation != null)1018					{1019						val4 = qERPolicy.CopyMN(metaTableRelation, "UID_ComplianceArea", lp.Entity, eCopy, lp).ConfigureAwait(false);1020						val = ((ConfiguredTaskAwaitable)(ref val4)).GetAwaiter();1021						if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)1022						{1023							num = (_003C_003E1__state = 2);1024							_003C_003Eu__3 = val;1025							((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnWorkingCopySaved_003Ed__7>(ref val, ref this);1026							return;1027						}1028						goto IL_01d9;1029					}1030					goto IL_01e0;1031					IL_01e0:1032					metaTableRelation2 = Enumerable.FirstOrDefault<IMetaTableRelation>((System.Collections.Generic.IEnumerable<IMetaTableRelation>)_003CmRels_003E5__2, (Func<IMetaTableRelation, bool>)((IMetaTableRelation r) => r.ChildTableName == "QERPolicyHasMControl"));1033					if (metaTableRelation2 != null)1034					{1035						val4 = qERPolicy.CopyMN(metaTableRelation2, "UID_MitigatingControl", lp.Entity, eCopy, lp).ConfigureAwait(false);1036						val = ((ConfiguredTaskAwaitable)(ref val4)).GetAwaiter();1037						if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)1038						{1039							num = (_003C_003E1__state = 3);1040							_003C_003Eu__3 = val;1041							((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnWorkingCopySaved_003Ed__7>(ref val, ref this);1042							return;1043						}1044						goto IL_028f;1045					}1046					goto IL_0296;1047					IL_01d9:1048					((ConfiguredTaskAwaiter)(ref val)).GetResult();1049					goto IL_01e0;1050				}1051				((ConfiguredTaskAwaiter)(ref val)).GetResult();1052			}1053			catch (System.Exception exception)1054			{1055				_003C_003E1__state = -2;1056				_003CmRels_003E5__2 = null;1057				((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);1058				return;1059			}1060			_003C_003E1__state = -2;1061			_003CmRels_003E5__2 = null;1062			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();1063		}10641065		[DebuggerHidden]1066		private void SetStateMachine(IAsyncStateMachine stateMachine)1067		{1068			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);1069		}1070	}10711072	[StructLayout((LayoutKind)3)]1073	[CompilerGenerated]1074	private struct _003C_Check_UID_DialogTable_003Ed__5 : IAsyncStateMachine1075	{1076		public int _003C_003E1__state;10771078		public AsyncTaskMethodBuilder<bool> _003C_003Et__builder;10791080		public string uidDialogTable;10811082		public ISession session;10831084		public CancellationToken ct;10851086		private _003C_003Ec__DisplayClass5_0 _003C_003E8__1;10871088		private ConfiguredTaskAwaiter<string> _003C_003Eu__1;10891090		private ConfiguredTaskAwaiter<IMetaTable> _003C_003Eu__2;10911092		private void MoveNext()1093		{1094			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)1095			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)1096			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)1097			//IL_0104: Unknown result type (might be due to invalid IL or missing references)1098			//IL_010f: Unknown result type (might be due to invalid IL or missing references)1099			//IL_0114: Unknown result type (might be due to invalid IL or missing references)1100			//IL_0118: Unknown result type (might be due to invalid IL or missing references)1101			//IL_011d: Unknown result type (might be due to invalid IL or missing references)1102			//IL_014d: Unknown result type (might be due to invalid IL or missing references)1103			//IL_0152: Unknown result type (might be due to invalid IL or missing references)1104			//IL_015a: Unknown result type (might be due to invalid IL or missing references)1105			//IL_0132: Unknown result type (might be due to invalid IL or missing references)1106			//IL_0134: Unknown result type (might be due to invalid IL or missing references)1107			//IL_008a: Unknown result type (might be due to invalid IL or missing references)1108			//IL_0095: Unknown result type (might be due to invalid IL or missing references)1109			//IL_009a: Unknown result type (might be due to invalid IL or missing references)1110			//IL_009e: Unknown result type (might be due to invalid IL or missing references)1111			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)1112			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)1113			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)1114			int num = _003C_003E1__state;1115			bool result;1116			try1117			{1118				ConfiguredTaskAwaiter<string> val;1119				if (num == 0)1120				{1121					val = _003C_003Eu__1;1122					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<string>);1123					num = (_003C_003E1__state = -1);1124					goto IL_00ef;1125				}1126				ConfiguredTaskAwaiter<IMetaTable> val2;1127				if (num == 1)1128				{1129					val2 = _003C_003Eu__2;1130					_003C_003Eu__2 = default(ConfiguredTaskAwaiter<IMetaTable>);1131					num = (_003C_003E1__state = -1);1132					goto IL_0169;1133				}1134				_003C_003E8__1 = new _003C_003Ec__DisplayClass5_0();1135				_003C_003E8__1.uidDialogTable = uidDialogTable;1136				if (!string.IsNullOrEmpty(_003C_003E8__1.uidDialogTable))1137				{1138					Query query = (from c in Query.From("DialogTable")1139						where c.Column("UID_DialogTable") == _003C_003E8__1.uidDialogTable1140						select c).Select("TableName");1141					val = session.Source().GetSingleValueAsync<string>(query, ct).ConfigureAwait(false)1142						.GetAwaiter();1143					if (!val.IsCompleted)1144					{1145						num = (_003C_003E1__state = 0);1146						_003C_003Eu__1 = val;1147						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<string>, _003C_Check_UID_DialogTable_003Ed__5>(ref val, ref this);1148						return;1149					}1150					goto IL_00ef;1151				}1152				result = true;1153				goto end_IL_0007;1154				IL_0169:1155				if (val2.GetResult().IsDeactivated || _003C_003E8__1.uidDialogTable.StartsWith("QBM"))1156				{1157					throw new ViException(2124378, ExceptionRelevance.EndUser);1158				}1159				result = true;1160				goto end_IL_0007;1161				IL_00ef:1162				string result2 = val.GetResult();1163				val2 = session.MetaData().GetTableAsync(result2, ct).ConfigureAwait(false)1164					.GetAwaiter();1165				if (!val2.IsCompleted)1166				{1167					num = (_003C_003E1__state = 1);1168					_003C_003Eu__2 = val2;1169					_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IMetaTable>, _003C_Check_UID_DialogTable_003Ed__5>(ref val2, ref this);1170					return;1171				}1172				goto IL_0169;1173				end_IL_0007:;1174			}1175			catch (System.Exception exception)1176			{1177				_003C_003E1__state = -2;1178				_003C_003E8__1 = null;1179				_003C_003Et__builder.SetException(exception);1180				return;1181			}1182			_003C_003E1__state = -2;1183			_003C_003E8__1 = null;1184			_003C_003Et__builder.SetResult(result);1185		}11861187		[DebuggerHidden]1188		private void SetStateMachine(IAsyncStateMachine stateMachine)1189		{1190			_003C_003Et__builder.SetStateMachine(stateMachine);1191		}1192	}11931194	[StructLayout((LayoutKind)3)]1195	[CompilerGenerated]1196	private struct _003C_Check_WhereClause_003Ed__4 : IAsyncStateMachine1197	{1198		public int _003C_003E1__state;11991200		public AsyncTaskMethodBuilder _003C_003Et__builder;12011202		public LogicParameter lp;12031204		private ConfiguredTaskAwaiter<IEntityCollection> _003C_003Eu__1;12051206		private void MoveNext()1207		{1208			//IL_0116: Unknown result type (might be due to invalid IL or missing references)1209			//IL_011b: Unknown result type (might be due to invalid IL or missing references)1210			//IL_0123: Unknown result type (might be due to invalid IL or missing references)1211			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)1212			//IL_00db: Unknown result type (might be due to invalid IL or missing references)1213			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)1214			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)1215			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)1216			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)1217			//IL_0100: Unknown result type (might be due to invalid IL or missing references)1218			int num = _003C_003E1__state;1219			try1220			{1221				if (num == 0)1222				{1223					goto IL_0087;1224				}1225				string value = default(string);1226				if (lp.Entity.Columns["WhereClause"].IsChanged || lp.Entity.Columns["UID_DialogTable"].IsChanged)1227				{1228					ISqlFormatter sqlFormatter = lp.SqlFormatter;1229					value = lp.Entity.GetValue<string>("WhereClause");1230					if (!string.IsNullOrEmpty(value))1231					{1232						sqlFormatter.CleanWhereClause(value);1233						goto IL_0087;1234					}1235				}1236				goto end_IL_0007;1237				IL_0087:1238				try1239				{1240					ConfiguredTaskAwaiter<IEntityCollection> val;1241					if (num != 0)1242					{1243						Query query = Query.From(lp.ObjectWalker.GetValue<string>("FK(UID_DialogTable).TableName")).Where(value).Take(1)1244							.SelectNone();1245						val = lp.Session.Source().GetCollectionAsync(query, lp.CancellationToken).ConfigureAwait(false)1246							.GetAwaiter();1247						if (!val.IsCompleted)1248						{1249							num = (_003C_003E1__state = 0);1250							_003C_003Eu__1 = val;1251							((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntityCollection>, _003C_Check_WhereClause_003Ed__4>(ref val, ref this);1252							return;1253						}1254					}1255					else1256					{1257						val = _003C_003Eu__1;1258						_003C_003Eu__1 = default(ConfiguredTaskAwaiter<IEntityCollection>);1259						num = (_003C_003E1__state = -1);1260					}1261					val.GetResult();1262				}1263				catch (System.Exception innerException)1264				{1265					throw new ViException(2124381, ExceptionRelevance.EndUser, innerException);1266				}1267				end_IL_0007:;1268			}1269			catch (System.Exception exception)1270			{1271				_003C_003E1__state = -2;1272				((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);1273				return;1274			}1275			_003C_003E1__state = -2;1276			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();1277		}12781279		[DebuggerHidden]1280		private void SetStateMachine(IAsyncStateMachine stateMachine)1281		{1282			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);1283		}1284	}12851286	[StructLayout((LayoutKind)3)]1287	[CompilerGenerated]1288	private struct _003C_Handle_QERPolicyHasObject_003Ed__3 : IAsyncStateMachine1289	{1290		public int _003C_003E1__state;12911292		public AsyncTaskMethodBuilder _003C_003Et__builder;12931294		public LogicParameter lp;12951296		public QERPolicy _003C_003E4__this;12971298		private ISqlFormatter _003CfSql_003E5__2;12991300		private ConfiguredTaskAwaiter<IEntityCollection> _003C_003Eu__1;13011302		private System.Collections.Generic.IEnumerator<IEntity> _003C_003E7__wrap2;13031304		private ConfiguredTaskAwaiter _003C_003Eu__2;13051306		private IEntity _003CePhOd_003E5__4;13071308		private System.IDisposable _003C_003E7__wrap4;13091310		private ConfiguredValueTaskAwaiter _003C_003Eu__3;13111312		private void MoveNext()1313		{1314			//IL_0139: Unknown result type (might be due to invalid IL or missing references)1315			//IL_013e: Unknown result type (might be due to invalid IL or missing references)1316			//IL_0146: Unknown result type (might be due to invalid IL or missing references)1317			//IL_0347: Unknown result type (might be due to invalid IL or missing references)1318			//IL_034c: Unknown result type (might be due to invalid IL or missing references)1319			//IL_0354: Unknown result type (might be due to invalid IL or missing references)1320			//IL_0227: Unknown result type (might be due to invalid IL or missing references)1321			//IL_022c: Unknown result type (might be due to invalid IL or missing references)1322			//IL_0234: Unknown result type (might be due to invalid IL or missing references)1323			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)1324			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)1325			//IL_0100: Unknown result type (might be due to invalid IL or missing references)1326			//IL_0104: Unknown result type (might be due to invalid IL or missing references)1327			//IL_0109: Unknown result type (might be due to invalid IL or missing references)1328			//IL_011e: Unknown result type (might be due to invalid IL or missing references)1329			//IL_0120: Unknown result type (might be due to invalid IL or missing references)1330			//IL_01de: Unknown result type (might be due to invalid IL or missing references)1331			//IL_01e9: Unknown result type (might be due to invalid IL or missing references)1332			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)1333			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)1334			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)1335			//IL_041c: Unknown result type (might be due to invalid IL or missing references)1336			//IL_0421: Unknown result type (might be due to invalid IL or missing references)1337			//IL_0429: Unknown result type (might be due to invalid IL or missing references)1338			//IL_020c: Unknown result type (might be due to invalid IL or missing references)1339			//IL_020e: Unknown result type (might be due to invalid IL or missing references)1340			//IL_02fe: Unknown result type (might be due to invalid IL or missing references)1341			//IL_0309: Unknown result type (might be due to invalid IL or missing references)1342			//IL_030e: Unknown result type (might be due to invalid IL or missing references)1343			//IL_0312: Unknown result type (might be due to invalid IL or missing references)1344			//IL_0317: Unknown result type (might be due to invalid IL or missing references)1345			//IL_0456: Unknown result type (might be due to invalid IL or missing references)1346			//IL_0461: Unknown result type (might be due to invalid IL or missing references)1347			//IL_0466: Unknown result type (might be due to invalid IL or missing references)1348			//IL_046a: Unknown result type (might be due to invalid IL or missing references)1349			//IL_046f: Unknown result type (might be due to invalid IL or missing references)1350			//IL_049f: Unknown result type (might be due to invalid IL or missing references)1351			//IL_04a4: Unknown result type (might be due to invalid IL or missing references)1352			//IL_04ac: Unknown result type (might be due to invalid IL or missing references)1353			//IL_03cf: Unknown result type (might be due to invalid IL or missing references)1354			//IL_03de: Unknown result type (might be due to invalid IL or missing references)1355			//IL_03e3: Unknown result type (might be due to invalid IL or missing references)1356			//IL_03e7: Unknown result type (might be due to invalid IL or missing references)1357			//IL_03ec: Unknown result type (might be due to invalid IL or missing references)1358			//IL_032c: Unknown result type (might be due to invalid IL or missing references)1359			//IL_032e: Unknown result type (might be due to invalid IL or missing references)1360			//IL_0484: Unknown result type (might be due to invalid IL or missing references)1361			//IL_0486: Unknown result type (might be due to invalid IL or missing references)1362			//IL_0401: Unknown result type (might be due to invalid IL or missing references)1363			//IL_0403: Unknown result type (might be due to invalid IL or missing references)1364			int num = _003C_003E1__state;1365			QERPolicy qERPolicy = _003C_003E4__this;1366			try1367			{1368				ConfiguredTaskAwaiter val2;1369				ConfiguredTaskAwaitable val3;1370				ConfiguredTaskAwaiter<IEntityCollection> val;1371				IEntityCollection result;1372				IEntityCollection result2;1373				switch (num)1374				{1375				default:1376				{1377					bool value = lp.Entity.GetValue<bool>("IsExceptionAllowed");1378					if (lp.Entity.GetValue<bool>("IsExceptionAllowed[o]") && !value)1379					{1380						_003CfSql_003E5__2 = lp.SqlFormatter;1381						Query query = Query.From("QERPolicyHasObject").Where(_003CfSql_003E5__2.AndRelation(_003CfSql_003E5__2.UidComparison("UID_QERPolicy", lp.Entity.GetValue<string>("UID_QERPolicy")), _003CfSql_003E5__2.Comparison("IsExceptionGranted", true, ValType.Bool))).SelectAll();1382						val = lp.Session.Source().GetCollectionAsync(query, EntityCollectionLoadType.Bulk, lp.CancellationToken).ConfigureAwait(false)1383							.GetAwaiter();1384						if (!val.IsCompleted)1385						{1386							num = (_003C_003E1__state = 0);1387							_003C_003Eu__1 = val;1388							((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntityCollection>, _003C_Handle_QERPolicyHasObject_003Ed__3>(ref val, ref this);1389							return;1390						}1391						goto IL_0155;1392					}1393					goto end_IL_000e;1394				}1395				case 0:1396					val = _003C_003Eu__1;1397					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<IEntityCollection>);1398					num = (_003C_003E1__state = -1);1399					goto IL_0155;1400				case 1:1401				{1402					try1403					{1404						if (num != 1)1405						{1406							goto IL_024a;1407						}1408						val2 = _003C_003Eu__2;1409						_003C_003Eu__2 = default(ConfiguredTaskAwaiter);1410						num = (_003C_003E1__state = -1);1411						goto IL_0243;1412						IL_0243:1413						((ConfiguredTaskAwaiter)(ref val2)).GetResult();1414						goto IL_024a;1415						IL_024a:1416						if (((System.Collections.IEnumerator)_003C_003E7__wrap2).MoveNext())1417						{1418							IEntity current = _003C_003E7__wrap2.Current;1419							current.SetValue("IsExceptionGranted", false);1420							current.SetValue("IsDecisionMade", true);1421							current.SetValue("UID_PersonDecisionMade", "");1422							current.SetValue("DecisionReason", "Exception revoked because of policy changes.");1423							val3 = lp.UnitOfWork.PutAsync(current, lp.CancellationToken).ConfigureAwait(false);1424							val2 = ((ConfiguredTaskAwaitable)(ref val3)).GetAwaiter();1425							if (!((ConfiguredTaskAwaiter)(ref val2)).IsCompleted)1426							{1427								num = (_003C_003E1__state = 1);1428								_003C_003Eu__2 = val2;1429								((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003C_Handle_QERPolicyHasObject_003Ed__3>(ref val2, ref this);1430								return;1431							}1432							goto IL_0243;1433						}1434					}1435					finally1436					{1437						if (num < 0 && _003C_003E7__wrap2 != null)1438						{1439							((System.IDisposable)_003C_003E7__wrap2).Dispose();1440						}1441					}1442					_003C_003E7__wrap2 = null;1443					Query query2 = Query.From("QERPolicyHasObject").Where(_003CfSql_003E5__2.AndRelation(_003CfSql_003E5__2.UidComparison("UID_QERPolicy", lp.Entity.GetValue<string>("UID_QERPolicy")), _003CfSql_003E5__2.Comparison("IsDecisionMade", false, ValType.Bool))).SelectAll();1444					val = lp.Session.Source().GetCollectionAsync(query2, EntityCollectionLoadType.Bulk, lp.CancellationToken).ConfigureAwait(false)1445						.GetAwaiter();1446					if (!val.IsCompleted)1447					{1448						num = (_003C_003E1__state = 2);1449						_003C_003Eu__1 = val;1450						((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntityCollection>, _003C_Handle_QERPolicyHasObject_003Ed__3>(ref val, ref this);1451						return;1452					}1453					goto IL_0363;1454				}1455				case 2:1456					val = _003C_003Eu__1;1457					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<IEntityCollection>);1458					num = (_003C_003E1__state = -1);1459					goto IL_0363;1460				case 3:1461				case 4:1462					break;1463					IL_0155:1464					result = val.GetResult();1465					_003C_003E7__wrap2 = ((System.Collections.Generic.IEnumerable<IEntity>)result).GetEnumerator();1466					goto case 1;1467					IL_0363:1468					result2 = val.GetResult();1469					_003C_003E7__wrap2 = ((System.Collections.Generic.IEnumerable<IEntity>)result2).GetEnumerator();1470					break;1471				}1472				try1473				{1474					if ((uint)(num - 3) <= 1u)1475					{1476						goto IL_03a3;1477					}1478					goto IL_04ea;1479					IL_04ea:1480					if (((System.Collections.IEnumerator)_003C_003E7__wrap2).MoveNext())1481					{1482						_003CePhOd_003E5__4 = _003C_003E7__wrap2.Current;1483						_003C_003E7__wrap4 = qERPolicy.StartInternalProcess();1484						goto IL_03a3;1485					}1486					goto end_IL_037a;1487					IL_03a3:1488					try1489					{1490						ConfiguredValueTaskAwaiter val5;1491						if (num != 3)1492						{1493							if (num == 4)1494							{1495								val2 = _003C_003Eu__2;1496								_003C_003Eu__2 = default(ConfiguredTaskAwaiter);1497								num = (_003C_003E1__state = -1);1498								goto IL_04bb;1499							}1500							ConfiguredValueTaskAwaitable val4 = _003CePhOd_003E5__4.CallMethodAsync("MakeDecision", "sa", p2: false, "", "POL-Policy-Changed", lp.CancellationToken).ConfigureAwait(false);1501							val5 = ((ConfiguredValueTaskAwaitable)(ref val4)).GetAwaiter();1502							if (!((ConfiguredValueTaskAwaiter)(ref val5)).IsCompleted)1503							{1504								num = (_003C_003E1__state = 3);1505								_003C_003Eu__3 = val5;1506								((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter, _003C_Handle_QERPolicyHasObject_003Ed__3>(ref val5, ref this);1507								return;1508							}1509						}1510						else1511						{1512							val5 = _003C_003Eu__3;1513							_003C_003Eu__3 = default(ConfiguredValueTaskAwaiter);1514							num = (_003C_003E1__state = -1);1515						}1516						((ConfiguredValueTaskAwaiter)(ref val5)).GetResult();1517						val3 = lp.UnitOfWork.PutAsync(_003CePhOd_003E5__4, lp.CancellationToken).ConfigureAwait(false);1518						val2 = ((ConfiguredTaskAwaitable)(ref val3)).GetAwaiter();1519						if (!((ConfiguredTaskAwaiter)(ref val2)).IsCompleted)1520						{1521							num = (_003C_003E1__state = 4);1522							_003C_003Eu__2 = val2;1523							((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003C_Handle_QERPolicyHasObject_003Ed__3>(ref val2, ref this);1524							return;1525						}1526						goto IL_04bb;1527						IL_04bb:1528						((ConfiguredTaskAwaiter)(ref val2)).GetResult();1529					}1530					finally1531					{1532						if (num < 0 && _003C_003E7__wrap4 != null)1533						{1534							_003C_003E7__wrap4.Dispose();1535						}1536					}1537					_003C_003E7__wrap4 = null;1538					_003CePhOd_003E5__4 = null;1539					goto IL_04ea;1540					end_IL_037a:;1541				}1542				finally1543				{1544					if (num < 0 && _003C_003E7__wrap2 != null)1545					{1546						((System.IDisposable)_003C_003E7__wrap2).Dispose();1547					}1548				}1549				_003C_003E7__wrap2 = null;1550				_003CfSql_003E5__2 = null;1551				end_IL_000e:;1552			}1553			catch (System.Exception exception)1554			{1555				_003C_003E1__state = -2;1556				((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);1557				return;1558			}1559			_003C_003E1__state = -2;1560			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();1561		}15621563		[DebuggerHidden]1564		private void SetStateMachine(IAsyncStateMachine stateMachine)1565		{1566			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);1567		}1568	}15691570	private static WorkingCopyEntityLogicParameter p;15711572	public QERPolicy(EntityLogicConstructionParameters cParams)1573		: base(cParams, p)1574	{1575		RegisterExpensive("_IsATT").As<bool>((Func<ISession, IEntity, IEntityWalker, CancellationToken, System.Threading.Tasks.Task<bool>>)((ISession s, IEntity e, IEntityWalker w, CancellationToken ct) => s.Config().IsPreprocessorEnabledAsync("ATTESTATION", ct)));1576		Check("UID_AERoleAttestator").AsExpensive<string>((Func<ISession, IEntity, IEntityWalker, string, CancellationToken, System.Threading.Tasks.Task<bool>>)((ISession s, IEntity e, IEntityWalker w, string v, CancellationToken ct) => AERole.CheckValidAERoleParent(s, v, DEFAULTAEROLE.QERPOLICY.ATTESTATOR, ct)));1577		Check("UID_AERoleRuler").AsExpensive<string>((Func<ISession, IEntity, IEntityWalker, string, CancellationToken, System.Threading.Tasks.Task<bool>>)((ISession s, IEntity e, IEntityWalker w, string v, CancellationToken ct) => AERole.CheckValidAERoleParent(s, v, DEFAULTAEROLE.QERPOLICY.EXCEPTION, ct)));1578		Check("UID_AERoleResponsible").AsExpensive<string>((Func<ISession, IEntity, IEntityWalker, string, CancellationToken, System.Threading.Tasks.Task<bool>>)((ISession s, IEntity e, IEntityWalker w, string v, CancellationToken ct) => AERole.CheckValidAERoleParent(s, v, DEFAULTAEROLE.QERPOLICY.RESPONSIBLE, ct)));1579		Check("UID_DialogTable").AsExpensive<string>((Func<ISession, IEntity, IEntityWalker, string, CancellationToken, System.Threading.Tasks.Task<bool>>)_Check_UID_DialogTable);1580		MinLen("UID_AERoleRuler").From("IsExceptionAllowed").As<bool>((Func<bool, int>)((bool b) => b ? 1 : 0));1581		MinLen("UID_DialogTable").From("IsNoWhereClause").As<bool>((Func<bool, int>)((bool b) => (!b) ? 1 : 0));1582		Value("WhereClause").From("UID_DialogTable", "UID_DialogTable[o]").As<string, string, TryResult<string>>((string uidNew, string uidOld) => TryResult.FromResult(uidNew != uidOld, ""));1583		RegisterMethod("RecalculatePolicy").As((ISession s, IEntity e, CancellationToken ct) => DbQueueOps.InsertAsync(s.Resolve<IDbSession>(), "POL-K-QERPolicyFill", e.GetValue<string>("UID_QERPolicy"), "", s.GenerateProcessId(), ct));1584		RegisterMethod("RecalculateAll").As((ISession s, IEntity e, CancellationToken ct) => DbQueueOps.InsertAsync(s.Resolve<IDbSession>(), "QBM-K-CommonRecalculate", "POL-K-QERPolicyFill", "", s.GenerateProcessId(), ct));1585		RegisterFunction("CreateAttestations").As<bool, DbObjectKey[]>(CreateAttestations).Enabled().From("IsInactive", "IsWorkingCopy", "_IsATT", "ObjectKeyAttPolicy")1586			.As<bool, bool, bool, string>((Func<bool, bool, bool, string, bool>)((bool isInactive, bool isWC, bool isATT, string uidAtt) => !isInactive && !isWC && isATT && !string.IsNullOrEmpty(uidAtt)))1587			.Behavior(MethodBehavior.ChangesExternalState)1588			.Description("Method_QERPolicy_CreateAttestations");1589	}15901591	[AsyncStateMachine(typeof(_003COnSavingAsync_003Ed__2))]1592	public override async System.Threading.Tasks.Task<Diff> OnSavingAsync(IEntity entity, LogicReadWriteParameters parameters, CancellationToken cancellationToken)1593	{1594		//IL_0002: Unknown result type (might be due to invalid IL or missing references)1595		//IL_0007: Unknown result type (might be due to invalid IL or missing references)1596		//IL_0026: Unknown result type (might be due to invalid IL or missing references)1597		//IL_0027: Unknown result type (might be due to invalid IL or missing references)1598		LogicParameter lp = new LogicParameter(entity, parameters, cancellationToken);1599		if (entity.GetValue<bool>("IsWorkingCopy"))1600		{1601			await _Check_WhereClause(lp).ConfigureAwait(false);1602		}1603		if (!entity.IsDeleted() && entity.IsLoaded && !entity.GetValue<bool>("IsWorkingCopy"))1604		{1605			await _Handle_QERPolicyHasObject(lp).ConfigureAwait(false);1606		}1607		bool flag = !entity.IsDeleted();1608		if (flag)1609		{1610			flag = await lp.Session.Config().IsPreprocessorEnabledAsync("ATTESTATION", cancellationToken).ConfigureAwait(false);1611		}1612		if (flag)1613		{1614			await CheckSameTable(parameters.Session, entity, cancellationToken).ConfigureAwait(false);1615		}1616		return await base.OnSavingAsync(entity, parameters, cancellationToken).ConfigureAwait(false);1617	}16181619	[AsyncStateMachine(typeof(_003C_Handle_QERPolicyHasObject_003Ed__3))]1620	private System.Threading.Tasks.Task _Handle_QERPolicyHasObject(LogicParameter lp)1621	{1622		//IL_0002: Unknown result type (might be due to invalid IL or missing references)1623		//IL_0007: Unknown result type (might be due to invalid IL or missing references)1624		_003C_Handle_QERPolicyHasObject_003Ed__3 _003C_Handle_QERPolicyHasObject_003Ed__ = default(_003C_Handle_QERPolicyHasObject_003Ed__3);1625		_003C_Handle_QERPolicyHasObject_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();1626		_003C_Handle_QERPolicyHasObject_003Ed__._003C_003E4__this = this;1627		_003C_Handle_QERPolicyHasObject_003Ed__.lp = lp;1628		_003C_Handle_QERPolicyHasObject_003Ed__._003C_003E1__state = -1;1629		((AsyncTaskMethodBuilder)(ref _003C_Handle_QERPolicyHasObject_003Ed__._003C_003Et__builder)).Start<_003C_Handle_QERPolicyHasObject_003Ed__3>(ref _003C_Handle_QERPolicyHasObject_003Ed__);1630		return ((AsyncTaskMethodBuilder)(ref _003C_Handle_QERPolicyHasObject_003Ed__._003C_003Et__builder)).Task;1631	}16321633	[AsyncStateMachine(typeof(_003C_Check_WhereClause_003Ed__4))]1634	private static System.Threading.Tasks.Task _Check_WhereClause(LogicParameter lp)1635	{1636		//IL_0002: Unknown result type (might be due to invalid IL or missing references)1637		//IL_0007: Unknown result type (might be due to invalid IL or missing references)1638		_003C_Check_WhereClause_003Ed__4 _003C_Check_WhereClause_003Ed__ = default(_003C_Check_WhereClause_003Ed__4);1639		_003C_Check_WhereClause_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();1640		_003C_Check_WhereClause_003Ed__.lp = lp;1641		_003C_Check_WhereClause_003Ed__._003C_003E1__state = -1;1642		((AsyncTaskMethodBuilder)(ref _003C_Check_WhereClause_003Ed__._003C_003Et__builder)).Start<_003C_Check_WhereClause_003Ed__4>(ref _003C_Check_WhereClause_003Ed__);1643		return ((AsyncTaskMethodBuilder)(ref _003C_Check_WhereClause_003Ed__._003C_003Et__builder)).Task;1644	}16451646	[AsyncStateMachine(typeof(_003C_Check_UID_DialogTable_003Ed__5))]1647	private async System.Threading.Tasks.Task<bool> _Check_UID_DialogTable(ISession session, IEntity entity, IEntityWalker walker, string uidDialogTable, CancellationToken ct)1648	{1649		//IL_0002: Unknown result type (might be due to invalid IL or missing references)1650		//IL_0007: Unknown result type (might be due to invalid IL or missing references)1651		//IL_001f: Unknown result type (might be due to invalid IL or missing references)1652		//IL_0021: Unknown result type (might be due to invalid IL or missing references)1653		if (string.IsNullOrEmpty(uidDialogTable))1654		{1655			return true;1656		}1657		Query query = (from c in Query.From("DialogTable")1658			where c.Column("UID_DialogTable") == uidDialogTable1659			select c).Select("TableName");1660		string tablename = await session.Source().GetSingleValueAsync<string>(query, ct).ConfigureAwait(false);1661		if ((await session.MetaData().GetTableAsync(tablename, ct).ConfigureAwait(false)).IsDeactivated || uidDialogTable.StartsWith("QBM"))1662		{1663			throw new ViException(2124378, ExceptionRelevance.EndUser);1664		}1665		return true;1666	}16671668	protected override System.Threading.Tasks.Task<QERPolicyFlags> GetEditFlags(IMetaTable m, IEntity e, ISession s)1669	{1670		QERPolicyFlags qERPolicyFlags = QERPolicyFlags.None;1671		if (e.GetValue<bool>("IsWorkingCopy"))1672		{1673			qERPolicyFlags |= QERPolicyFlags.IsWorkingCopy;1674		}1675		return System.Threading.Tasks.Task.FromResult<QERPolicyFlags>(qERPolicyFlags);1676	}16771678	[AsyncStateMachine(typeof(_003COnWorkingCopySaved_003Ed__7))]1679	protected override System.Threading.Tasks.Task OnWorkingCopySaved(IEntity eCopy, LogicParameter lp)1680	{1681		//IL_0002: Unknown result type (might be due to invalid IL or missing references)1682		//IL_0007: Unknown result type (might be due to invalid IL or missing references)1683		_003COnWorkingCopySaved_003Ed__7 _003COnWorkingCopySaved_003Ed__ = default(_003COnWorkingCopySaved_003Ed__7);1684		_003COnWorkingCopySaved_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();1685		_003COnWorkingCopySaved_003Ed__._003C_003E4__this = this;1686		_003COnWorkingCopySaved_003Ed__.eCopy = eCopy;1687		_003COnWorkingCopySaved_003Ed__.lp = lp;1688		_003COnWorkingCopySaved_003Ed__._003C_003E1__state = -1;1689		((AsyncTaskMethodBuilder)(ref _003COnWorkingCopySaved_003Ed__._003C_003Et__builder)).Start<_003COnWorkingCopySaved_003Ed__7>(ref _003COnWorkingCopySaved_003Ed__);1690		return ((AsyncTaskMethodBuilder)(ref _003COnWorkingCopySaved_003Ed__._003C_003Et__builder)).Task;1691	}16921693	[AsyncStateMachine(typeof(_003COnActiveCopySaved_003Ed__8))]1694	protected override System.Threading.Tasks.Task OnActiveCopySaved(IEntity eActive, LogicParameter lp)1695	{1696		//IL_0002: Unknown result type (might be due to invalid IL or missing references)1697		//IL_0007: Unknown result type (might be due to invalid IL or missing references)1698		_003COnActiveCopySaved_003Ed__8 _003COnActiveCopySaved_003Ed__ = default(_003COnActiveCopySaved_003Ed__8);1699		_003COnActiveCopySaved_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();1700		_003COnActiveCopySaved_003Ed__._003C_003E4__this = this;1701		_003COnActiveCopySaved_003Ed__.eActive = eActive;1702		_003COnActiveCopySaved_003Ed__.lp = lp;1703		_003COnActiveCopySaved_003Ed__._003C_003E1__state = -1;1704		((AsyncTaskMethodBuilder)(ref _003COnActiveCopySaved_003Ed__._003C_003Et__builder)).Start<_003COnActiveCopySaved_003Ed__8>(ref _003COnActiveCopySaved_003Ed__);1705		return ((AsyncTaskMethodBuilder)(ref _003COnActiveCopySaved_003Ed__._003C_003Et__builder)).Task;1706	}17071708	[AsyncStateMachine(typeof(_003CCheckSameTable_003Ed__9))]1709	private static System.Threading.Tasks.Task CheckSameTable(ISession session, IEntity entity, CancellationToken ct)1710	{1711		//IL_0002: Unknown result type (might be due to invalid IL or missing references)1712		//IL_0007: Unknown result type (might be due to invalid IL or missing references)1713		//IL_001e: Unknown result type (might be due to invalid IL or missing references)1714		//IL_001f: Unknown result type (might be due to invalid IL or missing references)1715		_003CCheckSameTable_003Ed__9 _003CCheckSameTable_003Ed__ = default(_003CCheckSameTable_003Ed__9);1716		_003CCheckSameTable_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();1717		_003CCheckSameTable_003Ed__.session = session;1718		_003CCheckSameTable_003Ed__.entity = entity;1719		_003CCheckSameTable_003Ed__.ct = ct;1720		_003CCheckSameTable_003Ed__._003C_003E1__state = -1;1721		((AsyncTaskMethodBuilder)(ref _003CCheckSameTable_003Ed__._003C_003Et__builder)).Start<_003CCheckSameTable_003Ed__9>(ref _003CCheckSameTable_003Ed__);1722		return ((AsyncTaskMethodBuilder)(ref _003CCheckSameTable_003Ed__._003C_003Et__builder)).Task;1723	}17241725	public static IColDbObject? PoliciesUsedByTaxonomy(IConnection con, string identTax)1726	{1727		//IL_0008: Unknown result type (might be due to invalid IL or missing references)1728		if (con == null)1729		{1730			throw new ArgumentNullException("con");1731		}1732		if (string.IsNullOrEmpty(identTax))1733		{1734			return null;1735		}1736		if (System.Array.BinarySearch<string>(con.PreprocessorDefines, "QAM", (IComparer<string>)(object)StringComparer.OrdinalIgnoreCase) < 0)1737		{1738			return null;1739		}1740		IColDbObject colDbObject = con.CreateCol("QERPolicy");1741		ISingleDbObject prototype = colDbObject.Prototype;1742		SqlStrings sqlStrings = con.SqlStrings;1743		object obj = con.SqlFormatter.FormatValue(identTax, ValType.String, forUpdate: true);1744		prototype.WhereClause = sqlStrings.FormatString("QERPolicy_PoliciesUsedByTaxonomy", new System.ReadOnlySpan<object>(ref obj));1745		colDbObject.Load();1746		return colDbObject;1747	}17481749	[AsyncStateMachine(typeof(_003CCreateAttestations_003Ed__11))]1750	private async System.Threading.Tasks.Task<DbObjectKey[]> CreateAttestations(ISession session, IEntity entity, bool bAll, CancellationToken ct)1751	{1752		//IL_0002: Unknown result type (might be due to invalid IL or missing references)1753		//IL_0007: Unknown result type (might be due to invalid IL or missing references)1754		//IL_0026: Unknown result type (might be due to invalid IL or missing references)1755		//IL_0028: Unknown result type (might be due to invalid IL or missing references)1756		await CheckSameTable(session, entity, ct).ConfigureAwait(false);1757		string uidQERPolicy = entity.Columns["UID_QERPolicy"].GetValue<string>();1758		ISelect sPolicyHasObject = from c in Query.From("QERPolicyHasObject")1759			where c.Column("UID_QERPolicy") == uidQERPolicy1760			select c;1761		if (!bAll)1762		{1763			sPolicyHasObject = sPolicyHasObject.Where((IExpressionContext c) => c.Column("IsDecisionMade") == false);1764		}1765		IEntityWalker wEntity = entity.CreateWalker(session);1766		IEntity eAttestationPolicy = (await wEntity.GetEntityAsync("FK(ObjectKeyAttPolicy)", ct).ConfigureAwait(false)).CreateInteractive(session);1767		session.SqlFormatter();1768		string strWhere = (string)(await eAttestationPolicy.CallFunctionAsync("GetWhereClause", ct).ConfigureAwait(false));1769		string text = await wEntity.GetValueAsync<string>("FK(UID_DialogTable).TableName", ct).ConfigureAwait(false);1770		string whereClause = $"ObjectKey not in (select XObjectKey from {text} where {strWhere})";1771		Query query = sPolicyHasObject.Where(whereClause).SelectDisplays();1772		IEntityCollection entityCollection = await session.Source().GetCollectionAsync(query, EntityCollectionLoadType.ForeignDisplaysForAllColumns, ct).ConfigureAwait(false);1773		if (((System.Collections.Generic.IReadOnlyCollection<IEntity>)entityCollection).Count > 0)1774		{1775			string text2 = string.Join(", ", Enumerable.Select<IEntity, string>(Enumerable.Take<IEntity>((System.Collections.Generic.IEnumerable<IEntity>)entityCollection, 3), (Func<IEntity, string>)((IEntity e) => e.Display)));1776			throw new ViException(2124383, ExceptionRelevance.EndUser, ((System.Collections.Generic.IReadOnlyCollection<IEntity>)entityCollection).Count, text2);1777		}1778		Query query2 = sPolicyHasObject.Select("ObjectKey");1779		IEntityCollection entityCollection2 = await session.Source().GetCollectionAsync(query2, EntityCollectionLoadType.Slim, ct).ConfigureAwait(false);1780		int iObjectKey = entityCollection2.ColumnIndices["ObjectKey"];1781		string[] parameter = Enumerable.ToArray<string>(Enumerable.Select<IEntity, string>((System.Collections.Generic.IEnumerable<IEntity>)entityCollection2, (Func<IEntity, string>)((IEntity e) => e.Columns[iObjectKey].GetValue<string>())));1782		return (DbObjectKey[])(await eAttestationPolicy.CallFunctionAsync("CreateAttestations", parameter, ct).ConfigureAwait(false));1783	}17841785	static QERPolicy()1786	{1787		WorkingCopyEntityLogicParameter obj = new WorkingCopyEntityLogicParameter1788		{1789			FKWorkColumn = "UID_QERPolicyWork"1790		};1791		Dictionary<string, string> obj2 = new Dictionary<string, string>((IEqualityComparer<string>)(object)StringComparer.OrdinalIgnoreCase);1792		obj2.Add("IsInactive", "FALSE");1793		obj2.Add("IsWorkingCopy", "FALSE");1794		obj2.Add("UID_QERPolicyWork", "FALSE");1795		obj2.Add("RiskIndex", "IsWorkingCopy");1796		obj2.Add("RiskIndexReduced", "FALSE");1797		obj.ColumnsDefinition = obj2;1798		List<string> obj3 = new List<string>();1799		obj3.Add("RiskIndexReduced");1800		obj3.Add("IsWorkingCopy");1801		obj3.Add("UID_QERPolicy");1802		obj3.Add("UID_QERPolicyWork");1803		obj3.Add("IsInactive");1804		obj.ExcludeColumns = obj3;1805		p = obj;1806	}1807}1808