Back to OIM Explorer

VI.DB.Compile/VI.DB.Compile/DialogJobGenAssemblyBuilder.cs

Decompiler Source FileVI.DB.Compile.DialogJobGenAssemblyBuilderDecompiled Source

10 extracted method/event/call references in DialogJobGenAssemblyBuilder.

Source: F:\Claude\.tmp\oim-decompiled-full\1176_One_Identity_Manager_VI.DB.Compile.dll\VI.DB.Compile\DialogJobGenAssemblyBuilder.cs

Source size: 125.247 characters

Interpretation

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

Relations

  • Event handler: Chain at line 1543
  • Event handler: ProcessTracking at line 1546
  • Event handler: EndChain at line 1548
  • Event handler: Header at line 1632
  • Event handler: Footer at line 1633
  • Event handler: Header at line 2571
  • Event handler: Footer at line 2572
  • Event handler: Chain at line 2599
  • Event handler: ProcessTracking at line 2602
  • Event handler: EndChain at line 2604

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 Job/process related markers

Summary: classes DialogJobGenAssemblyBuilder, _ValueReplacer, _003C_003Ec__DisplayClass21_0, _003C_003Ec__DisplayClass23_0; methods Replace, _ReplaceMatch, _003C_GenerateEventsAsync_003Eb__0, _003C_GenerateJobAsync_003Eb__0, MoveNext, SetStateMachine; references DialogTable, JobChain, JobComponent, JobEventGen, JobParameter, JobRunParameter; markers reads entity values, references DB/Dialog objects, Job/process related markers

Classes

DialogJobGenAssemblyBuilder _ValueReplacer _003C_003Ec__DisplayClass21_0 _003C_003Ec__DisplayClass23_0

OIM key/entity markers

ObjectKey UID_QBMEvent UID_Job UID_DialogTable UID_JobChain UID_Jobtask UID_SuccessJob UID_ErrorJob UID_QBMServerTag UID_JobParameter

API/entity calls

GetValue GetValueAsync Config MetaData Source From CreateAsync SqlFormatter GetValue

Registrations / handlers

None extracted.

Complete Source

C#2.719 lines
1using System;2using System.Collections;3using System.Collections.Generic;4using System.Diagnostics;5using System.Globalization;6using System.IO;7using System.Linq;8using System.Runtime.CompilerServices;9using System.Runtime.InteropServices;10using System.Text;11using System.Text.RegularExpressions;12using System.Threading;13using System.Threading.Tasks;14using VI.Base;15using VI.Base.Helper;16using VI.Base.Scripting;17using VI.DB.Entities;18using VI.DB.MetaData;19using VI.DB.Scripting;20using VI.DB.Sync;2122namespace VI.DB.Compile;2324public class DialogJobGenAssemblyBuilder : JobGenAssemblyBuilderBase25{26	private class _ValueReplacer27	{28		private static readonly Regex _reg = new Regex("\\[%(?<value>[^%:]+)(:(?<format>\\w+))?%\\]", (RegexOptions)513);2930		private static readonly Regex _regVersion = new Regex("([0-9]{3})([0-9]{3})([0-9]{4})([0-9]{4})", (RegexOptions)512);3132		private readonly IValueProvider _provider;3334		private readonly IMetaTable _baseTable;3536		public _ValueReplacer(IMetaTable baseTable, IValueProvider provider)37		{38			_baseTable = baseTable;39			_provider = provider;40		}4142		public string Replace(string input)43		{44			//IL_0019: Unknown result type (might be due to invalid IL or missing references)45			//IL_0023: Expected O, but got Unknown46			string text = ((Dictionary<string, string>)_Code)[input];47			return _reg.Replace(text, new MatchEvaluator(_ReplaceMatch));48		}4950		private string _ReplaceMatch(Match m)51		{52			string value = ((Capture)m.Groups["value"]).Value;53			Group val = m.Groups["format"];54			if (string.Equals(value, "ObjectKey", (StringComparison)5))55			{56				return new DbObjectKey(_baseTable, _provider).ToXmlString();57			}58			DbVal value2 = _provider.GetValue(value);59			if (!val.Success)60			{61				return value2.String;62			}63			string text = ((Capture)val).Value.ToLowerInvariant();64			if (text != null)65			{66				switch (text.Length)67				{68				case 2:69					switch (text[0])70					{71					case 'f':72						if (!(text == "fn"))73						{74							break;75						}76						return FunctionName.Create(value2.String);77					case 'l':78						if (!(text == "ld"))79						{80							break;81						}82						return ScriptSyntax.ReplaceLanguageDependentExpressions(_baseTable.Tablename, value, value2.String);83					case 'c':84					{85						if (!(text == "cd"))86						{87							break;88						}89						IMetaColumn value3;90						return (_baseTable.Columns.TryGetValue(value, out value3) ? value3.Display.Translated : value).Replace("\"", "\"\"");91					}92					}93					break;94				case 3:95					if (!(text == "int"))96					{97						break;98					}99					return value2.Int.ToString((IFormatProvider)(object)CultureInfo.InvariantCulture);100				case 4:101					if (!(text == "bool"))102					{103						break;104					}105					if (!value2.Bool)106					{107						return "False";108					}109					return "True";110				case 7:111				{112					if (!(text == "version"))113					{114						break;115					}116					int[] array = new int[4];117					Match val2 = _regVersion.Match(value2.String);118					if (((Group)val2).Success)119					{120						for (int i = 0; i < 4; i++)121						{122							array[i] = int.Parse(((Capture)val2.Groups[i + 1]).Value);123						}124						CultureInfo invariantCulture = CultureInfo.InvariantCulture;125						global::_003C_003Ey__InlineArray4<object> buffer = default(global::_003C_003Ey__InlineArray4<object>);126						global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray4<object>, object>(ref buffer, 0) = array[0];127						global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray4<object>, object>(ref buffer, 1) = array[1];128						global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray4<object>, object>(ref buffer, 2) = array[2];129						global::_003CPrivateImplementationDetails_003E.InlineArrayElementRef<global::_003C_003Ey__InlineArray4<object>, object>(ref buffer, 3) = array[3];130						return string.Format((IFormatProvider)(object)invariantCulture, "{0}.{1}.{2}.{3}", global::_003CPrivateImplementationDetails_003E.InlineArrayAsReadOnlySpan<global::_003C_003Ey__InlineArray4<object>, object>(in buffer, 4));131					}132					return value2.String;133				}134				case 6:135					if (!(text == "string"))136					{137						break;138					}139					return value2.String.Replace("\"", "\"\"").Replace("\ufffd", "\"\"").Replace("\ufffd", "\"\"");140				}141			}142			return value2.String;143		}144	}145146	[CompilerGenerated]147	private sealed class _003C_003Ec__DisplayClass21_0148	{149		public IEntityCollection jobEventGens;150151		public Dictionary<string, IEntity> qbmEvents;152153		internal ExpressionClause _003C_GenerateEventsAsync_003Eb__0(IExpressionContext t)154		{155			return t.Column("UID_QBMEvent").In(Enumerable.Select<IEntity, string>((System.Collections.Generic.IEnumerable<IEntity>)jobEventGens, (Func<IEntity, string>)((IEntity e) => e.GetValue<string>("UID_QBMEvent"))));156		}157158		internal global::_003C_003Ef__AnonymousType0<IEntity, IEntity> _003C_GenerateEventsAsync_003Eb__1(IEntity e)159		{160			IEntity qBMEvent = default(IEntity);161			qbmEvents.TryGetValue(e.GetValue<string>("UID_QBMEvent"), ref qBMEvent);162			return new163			{164				JobEventGen = e,165				QBMEvent = qBMEvent166			};167		}168	}169170	[CompilerGenerated]171	private sealed class _003C_003Ec__DisplayClass23_0172	{173		public string uidJob;174175		public Func<IEntity, bool> _003C_003E9__0;176177		internal bool _003C_GenerateJobAsync_003Eb__0(IEntity p)178		{179			return p.GetValue<string>("UID_Job") == uidJob;180		}181	}182183	[StructLayout((LayoutKind)3)]184	[CompilerGenerated]185	private struct _003CCreateAsync_003Ed__11 : IAsyncStateMachine186	{187		public int _003C_003E1__state;188189		public AsyncTaskMethodBuilder<DialogJobGenAssemblyBuilder> _003C_003Et__builder;190191		public string[] preprocDefines;192193		public ISession session;194195		public CancellationToken ct;196197		public IMetaTable table;198199		public ScriptCompilerOptions options;200201		private ConfiguredTaskAwaiter<string[]> _003C_003Eu__1;202203		private void MoveNext()204		{205			//IL_0062: Unknown result type (might be due to invalid IL or missing references)206			//IL_0067: Unknown result type (might be due to invalid IL or missing references)207			//IL_006e: Unknown result type (might be due to invalid IL or missing references)208			//IL_001e: Unknown result type (might be due to invalid IL or missing references)209			//IL_0029: Unknown result type (might be due to invalid IL or missing references)210			//IL_002e: Unknown result type (might be due to invalid IL or missing references)211			//IL_0032: Unknown result type (might be due to invalid IL or missing references)212			//IL_0037: Unknown result type (might be due to invalid IL or missing references)213			//IL_004b: Unknown result type (might be due to invalid IL or missing references)214			//IL_004c: Unknown result type (might be due to invalid IL or missing references)215			int num = _003C_003E1__state;216			DialogJobGenAssemblyBuilder result2;217			try218			{219				ConfiguredTaskAwaiter<string[]> val;220				if (num != 0)221				{222					if (preprocDefines != null)223					{224						goto IL_008c;225					}226					val = session.Config().GetPreprocessorDefinesAsync(ct).ConfigureAwait(false)227						.GetAwaiter();228					if (!val.IsCompleted)229					{230						num = (_003C_003E1__state = 0);231						_003C_003Eu__1 = val;232						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<string[]>, _003CCreateAsync_003Ed__11>(ref val, ref this);233						return;234					}235				}236				else237				{238					val = _003C_003Eu__1;239					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<string[]>);240					num = (_003C_003E1__state = -1);241				}242				string[] result = val.GetResult();243				preprocDefines = result;244				goto IL_008c;245				IL_008c:246				result2 = new DialogJobGenAssemblyBuilder(session, table, preprocDefines, options);247			}248			catch (System.Exception exception)249			{250				_003C_003E1__state = -2;251				_003C_003Et__builder.SetException(exception);252				return;253			}254			_003C_003E1__state = -2;255			_003C_003Et__builder.SetResult(result2);256		}257258		[DebuggerHidden]259		private void SetStateMachine(IAsyncStateMachine stateMachine)260		{261			_003C_003Et__builder.SetStateMachine(stateMachine);262		}263	}264265	[StructLayout((LayoutKind)3)]266	[CompilerGenerated]267	private struct _003CCreateAsync_003Ed__12 : IAsyncStateMachine268	{269		public int _003C_003E1__state;270271		public AsyncTaskMethodBuilder<DialogJobGenAssemblyBuilder> _003C_003Et__builder;272273		public ISession session;274275		public string tablename;276277		public CancellationToken ct;278279		public string[] preprocDefines;280281		public ScriptCompilerOptions options;282283		private IMetaTable _003Ctable_003E5__2;284285		private ConfiguredTaskAwaiter<IMetaTable> _003C_003Eu__1;286287		private ConfiguredTaskAwaiter<string[]> _003C_003Eu__2;288289		private void MoveNext()290		{291			//IL_006a: Unknown result type (might be due to invalid IL or missing references)292			//IL_006f: Unknown result type (might be due to invalid IL or missing references)293			//IL_0076: Unknown result type (might be due to invalid IL or missing references)294			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)295			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)296			//IL_0101: Unknown result type (might be due to invalid IL or missing references)297			//IL_0023: Unknown result type (might be due to invalid IL or missing references)298			//IL_002e: Unknown result type (might be due to invalid IL or missing references)299			//IL_0033: Unknown result type (might be due to invalid IL or missing references)300			//IL_0037: Unknown result type (might be due to invalid IL or missing references)301			//IL_003c: Unknown result type (might be due to invalid IL or missing references)302			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)303			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)304			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)305			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)306			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)307			//IL_0050: Unknown result type (might be due to invalid IL or missing references)308			//IL_0051: Unknown result type (might be due to invalid IL or missing references)309			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)310			//IL_00db: Unknown result type (might be due to invalid IL or missing references)311			int num = _003C_003E1__state;312			DialogJobGenAssemblyBuilder result3;313			try314			{315				ConfiguredTaskAwaiter<string[]> val;316				ConfiguredTaskAwaiter<IMetaTable> val2;317				if (num != 0)318				{319					if (num == 1)320					{321						val = _003C_003Eu__2;322						_003C_003Eu__2 = default(ConfiguredTaskAwaiter<string[]>);323						num = (_003C_003E1__state = -1);324						goto IL_0110;325					}326					val2 = session.MetaData().GetTableAsync(tablename, ct).ConfigureAwait(false)327						.GetAwaiter();328					if (!val2.IsCompleted)329					{330						num = (_003C_003E1__state = 0);331						_003C_003Eu__1 = val2;332						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IMetaTable>, _003CCreateAsync_003Ed__12>(ref val2, ref this);333						return;334					}335				}336				else337				{338					val2 = _003C_003Eu__1;339					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<IMetaTable>);340					num = (_003C_003E1__state = -1);341				}342				IMetaTable result = val2.GetResult();343				_003Ctable_003E5__2 = result;344				if (preprocDefines == null)345				{346					val = session.Config().GetPreprocessorDefinesAsync(ct).ConfigureAwait(false)347						.GetAwaiter();348					if (!val.IsCompleted)349					{350						num = (_003C_003E1__state = 1);351						_003C_003Eu__2 = val;352						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<string[]>, _003CCreateAsync_003Ed__12>(ref val, ref this);353						return;354					}355					goto IL_0110;356				}357				goto IL_0121;358				IL_0110:359				string[] result2 = val.GetResult();360				preprocDefines = result2;361				goto IL_0121;362				IL_0121:363				result3 = new DialogJobGenAssemblyBuilder(session, _003Ctable_003E5__2, preprocDefines, options);364			}365			catch (System.Exception exception)366			{367				_003C_003E1__state = -2;368				_003Ctable_003E5__2 = null;369				_003C_003Et__builder.SetException(exception);370				return;371			}372			_003C_003E1__state = -2;373			_003Ctable_003E5__2 = null;374			_003C_003Et__builder.SetResult(result3);375		}376377		[DebuggerHidden]378		private void SetStateMachine(IAsyncStateMachine stateMachine)379		{380			_003C_003Et__builder.SetStateMachine(stateMachine);381		}382	}383384	[StructLayout((LayoutKind)3)]385	[CompilerGenerated]386	private struct _003CGenerateSourceAsync_003Ed__17 : IAsyncStateMachine387	{388		public int _003C_003E1__state;389390		public AsyncTaskMethodBuilder<string> _003C_003Et__builder;391392		public DialogJobGenAssemblyBuilder _003C_003E4__this;393394		public CancellationToken ct;395396		private StringBuilder _003Ccode_003E5__2;397398		private ISqlFormatter _003Cf_003E5__3;399400		private IdentityMap _003CidentityMap_003E5__4;401402		private ConfiguredTaskAwaiter<Dictionary<DbObjectKey, IEntity>> _003C_003Eu__1;403404		private ConfiguredTaskAwaiter _003C_003Eu__2;405406		private ConfiguredTaskAwaiter<bool> _003C_003Eu__3;407408		private void MoveNext()409		{410			//IL_010a: Unknown result type (might be due to invalid IL or missing references)411			//IL_010f: Unknown result type (might be due to invalid IL or missing references)412			//IL_0117: Unknown result type (might be due to invalid IL or missing references)413			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)414			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)415			//IL_01cc: Unknown result type (might be due to invalid IL or missing references)416			//IL_0274: Unknown result type (might be due to invalid IL or missing references)417			//IL_0279: Unknown result type (might be due to invalid IL or missing references)418			//IL_0281: Unknown result type (might be due to invalid IL or missing references)419			//IL_0329: Unknown result type (might be due to invalid IL or missing references)420			//IL_032e: Unknown result type (might be due to invalid IL or missing references)421			//IL_0336: Unknown result type (might be due to invalid IL or missing references)422			//IL_03d6: Unknown result type (might be due to invalid IL or missing references)423			//IL_03db: Unknown result type (might be due to invalid IL or missing references)424			//IL_03e3: Unknown result type (might be due to invalid IL or missing references)425			//IL_0483: Unknown result type (might be due to invalid IL or missing references)426			//IL_0488: Unknown result type (might be due to invalid IL or missing references)427			//IL_0490: Unknown result type (might be due to invalid IL or missing references)428			//IL_052e: Unknown result type (might be due to invalid IL or missing references)429			//IL_0533: Unknown result type (might be due to invalid IL or missing references)430			//IL_053b: Unknown result type (might be due to invalid IL or missing references)431			//IL_0176: Unknown result type (might be due to invalid IL or missing references)432			//IL_0181: Unknown result type (might be due to invalid IL or missing references)433			//IL_0186: Unknown result type (might be due to invalid IL or missing references)434			//IL_018a: Unknown result type (might be due to invalid IL or missing references)435			//IL_018f: Unknown result type (might be due to invalid IL or missing references)436			//IL_022b: Unknown result type (might be due to invalid IL or missing references)437			//IL_0236: Unknown result type (might be due to invalid IL or missing references)438			//IL_023b: Unknown result type (might be due to invalid IL or missing references)439			//IL_023f: Unknown result type (might be due to invalid IL or missing references)440			//IL_0244: Unknown result type (might be due to invalid IL or missing references)441			//IL_02e0: Unknown result type (might be due to invalid IL or missing references)442			//IL_02eb: Unknown result type (might be due to invalid IL or missing references)443			//IL_02f0: Unknown result type (might be due to invalid IL or missing references)444			//IL_02f4: Unknown result type (might be due to invalid IL or missing references)445			//IL_02f9: Unknown result type (might be due to invalid IL or missing references)446			//IL_038d: Unknown result type (might be due to invalid IL or missing references)447			//IL_0398: Unknown result type (might be due to invalid IL or missing references)448			//IL_039d: Unknown result type (might be due to invalid IL or missing references)449			//IL_03a1: Unknown result type (might be due to invalid IL or missing references)450			//IL_03a6: Unknown result type (might be due to invalid IL or missing references)451			//IL_043a: Unknown result type (might be due to invalid IL or missing references)452			//IL_0445: Unknown result type (might be due to invalid IL or missing references)453			//IL_044a: Unknown result type (might be due to invalid IL or missing references)454			//IL_044e: Unknown result type (might be due to invalid IL or missing references)455			//IL_0453: Unknown result type (might be due to invalid IL or missing references)456			//IL_04e5: Unknown result type (might be due to invalid IL or missing references)457			//IL_04f0: Unknown result type (might be due to invalid IL or missing references)458			//IL_04f5: Unknown result type (might be due to invalid IL or missing references)459			//IL_04f9: Unknown result type (might be due to invalid IL or missing references)460			//IL_04fe: Unknown result type (might be due to invalid IL or missing references)461			//IL_0059: Unknown result type (might be due to invalid IL or missing references)462			//IL_0063: Expected O, but got Unknown463			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)464			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)465			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)466			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)467			//IL_00da: Unknown result type (might be due to invalid IL or missing references)468			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)469			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)470			//IL_0259: Unknown result type (might be due to invalid IL or missing references)471			//IL_025b: Unknown result type (might be due to invalid IL or missing references)472			//IL_030e: Unknown result type (might be due to invalid IL or missing references)473			//IL_0310: Unknown result type (might be due to invalid IL or missing references)474			//IL_03bb: Unknown result type (might be due to invalid IL or missing references)475			//IL_03bd: Unknown result type (might be due to invalid IL or missing references)476			//IL_0468: Unknown result type (might be due to invalid IL or missing references)477			//IL_046a: Unknown result type (might be due to invalid IL or missing references)478			//IL_0513: Unknown result type (might be due to invalid IL or missing references)479			//IL_0515: Unknown result type (might be due to invalid IL or missing references)480			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)481			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)482			int num = _003C_003E1__state;483			DialogJobGenAssemblyBuilder dialogJobGenAssemblyBuilder = _003C_003E4__this;484			string result2;485			try486			{487				ConfiguredTaskAwaiter<Dictionary<DbObjectKey, IEntity>> val3;488				ConfiguredTaskAwaiter val2;489				ConfiguredTaskAwaiter<bool> val;490				ConfiguredTaskAwaitable val4;491				Dictionary<DbObjectKey, IEntity> result;492				switch (num)493				{494				default:495					if (dialogJobGenAssemblyBuilder.Table.IsDeactivated)496					{497						throw new ViException(810135, ExceptionRelevance.Technical, dialogJobGenAssemblyBuilder.Tablename);498					}499					_003Ccode_003E5__2 = new StringBuilder();500					_003Cf_003E5__3 = dialogJobGenAssemblyBuilder.Session.Resolve<ISqlFormatter>();501					_003CidentityMap_003E5__4 = new IdentityMap(dialogJobGenAssemblyBuilder.Session.Source());502					val3 = dialogJobGenAssemblyBuilder._BufferAndReturnObjectsAsync(Query.From("JobChain").Where(dialogJobGenAssemblyBuilder._BuildWhereClause(_003Cf_003E5__3, "UID_DialogTable", "NoGenerate", "UID_JobChain")).SelectNonLobs(), _003CidentityMap_003E5__4, ct).ConfigureAwait(false).GetAwaiter();503					if (!val3.IsCompleted)504					{505						num = (_003C_003E1__state = 0);506						_003C_003Eu__1 = val3;507						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<Dictionary<DbObjectKey, IEntity>>, _003CGenerateSourceAsync_003Ed__17>(ref val3, ref this);508						return;509					}510					goto IL_0126;511				case 0:512					val3 = _003C_003Eu__1;513					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<Dictionary<DbObjectKey, IEntity>>);514					num = (_003C_003E1__state = -1);515					goto IL_0126;516				case 1:517					val3 = _003C_003Eu__1;518					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<Dictionary<DbObjectKey, IEntity>>);519					num = (_003C_003E1__state = -1);520					goto IL_01db;521				case 2:522					val3 = _003C_003Eu__1;523					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<Dictionary<DbObjectKey, IEntity>>);524					num = (_003C_003E1__state = -1);525					goto IL_0290;526				case 3:527					val2 = _003C_003Eu__2;528					_003C_003Eu__2 = default(ConfiguredTaskAwaiter);529					num = (_003C_003E1__state = -1);530					goto IL_0345;531				case 4:532					val2 = _003C_003Eu__2;533					_003C_003Eu__2 = default(ConfiguredTaskAwaiter);534					num = (_003C_003E1__state = -1);535					goto IL_03f2;536				case 5:537					val2 = _003C_003Eu__2;538					_003C_003Eu__2 = default(ConfiguredTaskAwaiter);539					num = (_003C_003E1__state = -1);540					goto IL_049f;541				case 6:542					{543						val = _003C_003Eu__3;544						_003C_003Eu__3 = default(ConfiguredTaskAwaiter<bool>);545						num = (_003C_003E1__state = -1);546						break;547					}548					IL_049f:549					((ConfiguredTaskAwaiter)(ref val2)).GetResult();550					dialogJobGenAssemblyBuilder._chains = new HashSet<string>();551					dialogJobGenAssemblyBuilder._jobs = new HashSet<string>();552					_003Ccode_003E5__2.Append(((Dictionary<string, string>)_Code)["Header"]);553					val = dialogJobGenAssemblyBuilder._GenerateEventsAsync(_003Ccode_003E5__2, _003CidentityMap_003E5__4, ct).ConfigureAwait(false).GetAwaiter();554					if (!val.IsCompleted)555					{556						num = (_003C_003E1__state = 6);557						_003C_003Eu__3 = val;558						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<bool>, _003CGenerateSourceAsync_003Ed__17>(ref val, ref this);559						return;560					}561					break;562					IL_0290:563					result = val3.GetResult();564					dialogJobGenAssemblyBuilder._runParamObjs = result;565					val4 = dialogJobGenAssemblyBuilder._BufferObjectsAsync(Query.From("JobComponent").Where(string.Format("uid_jobcomponent in (select t.uid_jobcomponent from jobtask t join job j on j.uid_jobtask = t.uid_jobtask join jobchain c on c.uid_jobchain = j.uid_jobchain where {0})", (object)dialogJobGenAssemblyBuilder._BuildWhereClause(_003Cf_003E5__3, "c.UID_DialogTable", "c.NoGenerate", "c.UID_JobChain"))).SelectNonLobs(), _003CidentityMap_003E5__4, ct).ConfigureAwait(false);566					val2 = ((ConfiguredTaskAwaitable)(ref val4)).GetAwaiter();567					if (!((ConfiguredTaskAwaiter)(ref val2)).IsCompleted)568					{569						num = (_003C_003E1__state = 3);570						_003C_003Eu__2 = val2;571						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003CGenerateSourceAsync_003Ed__17>(ref val2, ref this);572						return;573					}574					goto IL_0345;575					IL_03f2:576					((ConfiguredTaskAwaiter)(ref val2)).GetResult();577					val4 = dialogJobGenAssemblyBuilder._BufferObjectsAsync(Query.From("JobParameter").Where(string.Format("uid_jobtask in (select j.uid_jobtask from job j join jobchain c on c.uid_jobchain = j.uid_jobchain where {0})", (object)dialogJobGenAssemblyBuilder._BuildWhereClause(_003Cf_003E5__3, "c.UID_DialogTable", "c.NoGenerate", "c.UID_JobChain"))).SelectNonLobs(), _003CidentityMap_003E5__4, ct).ConfigureAwait(false);578					val2 = ((ConfiguredTaskAwaitable)(ref val4)).GetAwaiter();579					if (!((ConfiguredTaskAwaiter)(ref val2)).IsCompleted)580					{581						num = (_003C_003E1__state = 5);582						_003C_003Eu__2 = val2;583						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003CGenerateSourceAsync_003Ed__17>(ref val2, ref this);584						return;585					}586					goto IL_049f;587					IL_0126:588					result = val3.GetResult();589					dialogJobGenAssemblyBuilder._chainObjs = result;590					val3 = dialogJobGenAssemblyBuilder._BufferAndReturnObjectsAsync(Query.From("Job").Where(string.Format("uid_jobchain in (select uid_jobchain from jobchain where {0})", (object)dialogJobGenAssemblyBuilder._BuildWhereClause(_003Cf_003E5__3, "UID_DialogTable", "NoGenerate", "UID_JobChain"))).SelectNonLobs(), _003CidentityMap_003E5__4, ct).ConfigureAwait(false).GetAwaiter();591					if (!val3.IsCompleted)592					{593						num = (_003C_003E1__state = 1);594						_003C_003Eu__1 = val3;595						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<Dictionary<DbObjectKey, IEntity>>, _003CGenerateSourceAsync_003Ed__17>(ref val3, ref this);596						return;597					}598					goto IL_01db;599					IL_0345:600					((ConfiguredTaskAwaiter)(ref val2)).GetResult();601					val4 = dialogJobGenAssemblyBuilder._BufferObjectsAsync(Query.From("JobTask").Where(string.Format("uid_jobtask in (select j.uid_jobtask from job j join jobchain c on c.uid_jobchain = j.uid_jobchain where {0})", (object)dialogJobGenAssemblyBuilder._BuildWhereClause(_003Cf_003E5__3, "c.UID_DialogTable", "c.NoGenerate", "c.UID_JobChain"))).SelectNonLobs(), _003CidentityMap_003E5__4, ct).ConfigureAwait(false);602					val2 = ((ConfiguredTaskAwaitable)(ref val4)).GetAwaiter();603					if (!((ConfiguredTaskAwaiter)(ref val2)).IsCompleted)604					{605						num = (_003C_003E1__state = 4);606						_003C_003Eu__2 = val2;607						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003CGenerateSourceAsync_003Ed__17>(ref val2, ref this);608						return;609					}610					goto IL_03f2;611					IL_01db:612					result = val3.GetResult();613					dialogJobGenAssemblyBuilder._jobObjs = result;614					val3 = dialogJobGenAssemblyBuilder._BufferAndReturnObjectsAsync(Query.From("JobRunParameter").Where(string.Format("uid_job in (select j.uid_job from job j join jobchain c on c.uid_jobchain = j.uid_jobchain where {0})", (object)dialogJobGenAssemblyBuilder._BuildWhereClause(_003Cf_003E5__3, "c.UID_DialogTable", "c.NoGenerate", "c.UID_JobChain"))).SelectNonLobs(), _003CidentityMap_003E5__4, ct).ConfigureAwait(false).GetAwaiter();615					if (!val3.IsCompleted)616					{617						num = (_003C_003E1__state = 2);618						_003C_003Eu__1 = val3;619						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<Dictionary<DbObjectKey, IEntity>>, _003CGenerateSourceAsync_003Ed__17>(ref val3, ref this);620						return;621					}622					goto IL_0290;623				}624				result2 = (val.GetResult() ? ((object)_003Ccode_003E5__2).ToString() : string.Empty);625			}626			catch (System.Exception exception)627			{628				_003C_003E1__state = -2;629				_003Ccode_003E5__2 = null;630				_003Cf_003E5__3 = null;631				_003CidentityMap_003E5__4 = null;632				_003C_003Et__builder.SetException(exception);633				return;634			}635			_003C_003E1__state = -2;636			_003Ccode_003E5__2 = null;637			_003Cf_003E5__3 = null;638			_003CidentityMap_003E5__4 = null;639			_003C_003Et__builder.SetResult(result2);640		}641642		[DebuggerHidden]643		private void SetStateMachine(IAsyncStateMachine stateMachine)644		{645			_003C_003Et__builder.SetStateMachine(stateMachine);646		}647	}648649	[StructLayout((LayoutKind)3)]650	[CompilerGenerated]651	private struct _003C_BufferAndReturnObjectsAsync_003Ed__19 : IAsyncStateMachine652	{653		public int _003C_003E1__state;654655		public AsyncTaskMethodBuilder<Dictionary<DbObjectKey, IEntity>> _003C_003Et__builder;656657		public DialogJobGenAssemblyBuilder _003C_003E4__this;658659		public Query query;660661		public CancellationToken cancellationToken;662663		public IdentityMap identityMap;664665		private IEntitySource _003Csrc_003E5__2;666667		private IMetaTable _003Ctable_003E5__3;668669		private Dictionary<DbObjectKey, IEntity> _003Cret_003E5__4;670671		private ConfiguredTaskAwaiter<IMetaTable> _003C_003Eu__1;672673		private ConfiguredTaskAwaiter<IEntityCollection> _003C_003Eu__2;674675		private System.Collections.Generic.IEnumerator<IEntity> _003C_003E7__wrap4;676677		private IEntity _003Centity_003E5__6;678679		private ConfiguredTaskAwaiter<DbObjectKey> _003C_003Eu__3;680681		private void MoveNext()682		{683			//IL_009a: Unknown result type (might be due to invalid IL or missing references)684			//IL_009f: Unknown result type (might be due to invalid IL or missing references)685			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)686			//IL_0122: Unknown result type (might be due to invalid IL or missing references)687			//IL_0127: Unknown result type (might be due to invalid IL or missing references)688			//IL_012f: Unknown result type (might be due to invalid IL or missing references)689			//IL_0051: Unknown result type (might be due to invalid IL or missing references)690			//IL_005c: Unknown result type (might be due to invalid IL or missing references)691			//IL_0061: Unknown result type (might be due to invalid IL or missing references)692			//IL_0065: Unknown result type (might be due to invalid IL or missing references)693			//IL_006a: Unknown result type (might be due to invalid IL or missing references)694			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)695			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)696			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)697			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)698			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)699			//IL_007f: Unknown result type (might be due to invalid IL or missing references)700			//IL_0081: Unknown result type (might be due to invalid IL or missing references)701			//IL_0107: Unknown result type (might be due to invalid IL or missing references)702			//IL_0109: Unknown result type (might be due to invalid IL or missing references)703			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)704			//IL_01d3: Unknown result type (might be due to invalid IL or missing references)705			//IL_01db: Unknown result type (might be due to invalid IL or missing references)706			//IL_0185: Unknown result type (might be due to invalid IL or missing references)707			//IL_0190: Unknown result type (might be due to invalid IL or missing references)708			//IL_0195: Unknown result type (might be due to invalid IL or missing references)709			//IL_0199: Unknown result type (might be due to invalid IL or missing references)710			//IL_019e: Unknown result type (might be due to invalid IL or missing references)711			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)712			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)713			int num = _003C_003E1__state;714			DialogJobGenAssemblyBuilder dialogJobGenAssemblyBuilder = _003C_003E4__this;715			Dictionary<DbObjectKey, IEntity> result4;716			try717			{718				ConfiguredTaskAwaiter<IMetaTable> val2;719				ConfiguredTaskAwaiter<IEntityCollection> val;720				IEntityCollection result;721				IMetaTable result2;722				switch (num)723				{724				default:725				{726					IMetaData metaData = dialogJobGenAssemblyBuilder.Session.Resolve<IMetaData>();727					_003Csrc_003E5__2 = dialogJobGenAssemblyBuilder.Session.Resolve<IEntitySource>();728					val2 = metaData.GetTableAsync(query.Table.Tablename, cancellationToken).ConfigureAwait(false).GetAwaiter();729					if (!val2.IsCompleted)730					{731						num = (_003C_003E1__state = 0);732						_003C_003Eu__1 = val2;733						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IMetaTable>, _003C_BufferAndReturnObjectsAsync_003Ed__19>(ref val2, ref this);734						return;735					}736					goto IL_00b6;737				}738				case 0:739					val2 = _003C_003Eu__1;740					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<IMetaTable>);741					num = (_003C_003E1__state = -1);742					goto IL_00b6;743				case 1:744					val = _003C_003Eu__2;745					_003C_003Eu__2 = default(ConfiguredTaskAwaiter<IEntityCollection>);746					num = (_003C_003E1__state = -1);747					goto IL_013e;748				case 2:749					break;750					IL_013e:751					result = val.GetResult();752					_003Cret_003E5__4 = new Dictionary<DbObjectKey, IEntity>();753					_003C_003E7__wrap4 = ((System.Collections.Generic.IEnumerable<IEntity>)result).GetEnumerator();754					break;755					IL_00b6:756					result2 = val2.GetResult();757					_003Ctable_003E5__3 = result2;758					val = _003Csrc_003E5__2.GetCollectionAsync(query, EntityCollectionLoadType.BulkReadOnly | EntityCollectionLoadType.Slim, cancellationToken).ConfigureAwait(false).GetAwaiter();759					if (!val.IsCompleted)760					{761						num = (_003C_003E1__state = 1);762						_003C_003Eu__2 = val;763						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntityCollection>, _003C_BufferAndReturnObjectsAsync_003Ed__19>(ref val, ref this);764						return;765					}766					goto IL_013e;767				}768				try769				{770					if (num != 2)771					{772						goto IL_0220;773					}774					ConfiguredTaskAwaiter<DbObjectKey> val3 = _003C_003Eu__3;775					_003C_003Eu__3 = default(ConfiguredTaskAwaiter<DbObjectKey>);776					num = (_003C_003E1__state = -1);777					goto IL_01ea;778					IL_01ea:779					DbObjectKey result3 = val3.GetResult();780					identityMap.RegisterEternal(result3, _003Centity_003E5__6);781					_003Cret_003E5__4[result3] = _003Centity_003E5__6;782					_003Centity_003E5__6 = null;783					goto IL_0220;784					IL_0220:785					if (((System.Collections.IEnumerator)_003C_003E7__wrap4).MoveNext())786					{787						_003Centity_003E5__6 = _003C_003E7__wrap4.Current;788						val3 = DbObjectKey.CreateAsync(_003Ctable_003E5__3, _003Centity_003E5__6, cancellationToken).ConfigureAwait(false).GetAwaiter();789						if (!val3.IsCompleted)790						{791							num = (_003C_003E1__state = 2);792							_003C_003Eu__3 = val3;793							_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<DbObjectKey>, _003C_BufferAndReturnObjectsAsync_003Ed__19>(ref val3, ref this);794							return;795						}796						goto IL_01ea;797					}798				}799				finally800				{801					if (num < 0 && _003C_003E7__wrap4 != null)802					{803						((System.IDisposable)_003C_003E7__wrap4).Dispose();804					}805				}806				_003C_003E7__wrap4 = null;807				result4 = _003Cret_003E5__4;808			}809			catch (System.Exception exception)810			{811				_003C_003E1__state = -2;812				_003Csrc_003E5__2 = null;813				_003Ctable_003E5__3 = null;814				_003Cret_003E5__4 = null;815				_003C_003Et__builder.SetException(exception);816				return;817			}818			_003C_003E1__state = -2;819			_003Csrc_003E5__2 = null;820			_003Ctable_003E5__3 = null;821			_003Cret_003E5__4 = null;822			_003C_003Et__builder.SetResult(result4);823		}824825		[DebuggerHidden]826		private void SetStateMachine(IAsyncStateMachine stateMachine)827		{828			_003C_003Et__builder.SetStateMachine(stateMachine);829		}830	}831832	[StructLayout((LayoutKind)3)]833	[CompilerGenerated]834	private struct _003C_BufferObjectsAsync_003Ed__20 : IAsyncStateMachine835	{836		public int _003C_003E1__state;837838		public AsyncTaskMethodBuilder _003C_003Et__builder;839840		public DialogJobGenAssemblyBuilder _003C_003E4__this;841842		public Query query;843844		public CancellationToken cancellationToken;845846		public IdentityMap identityMap;847848		private IEntitySource _003Csrc_003E5__2;849850		private IMetaTable _003Ctable_003E5__3;851852		private ConfiguredTaskAwaiter<IMetaTable> _003C_003Eu__1;853854		private ConfiguredTaskAwaiter<IEntityCollection> _003C_003Eu__2;855856		private System.Collections.Generic.IEnumerator<IEntity> _003C_003E7__wrap3;857858		private IEntity _003Centity_003E5__5;859860		private ConfiguredTaskAwaiter<DbObjectKey> _003C_003Eu__3;861862		private void MoveNext()863		{864			//IL_009a: Unknown result type (might be due to invalid IL or missing references)865			//IL_009f: Unknown result type (might be due to invalid IL or missing references)866			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)867			//IL_0120: Unknown result type (might be due to invalid IL or missing references)868			//IL_0125: Unknown result type (might be due to invalid IL or missing references)869			//IL_012d: Unknown result type (might be due to invalid IL or missing references)870			//IL_0051: Unknown result type (might be due to invalid IL or missing references)871			//IL_005c: Unknown result type (might be due to invalid IL or missing references)872			//IL_0061: Unknown result type (might be due to invalid IL or missing references)873			//IL_0065: Unknown result type (might be due to invalid IL or missing references)874			//IL_006a: Unknown result type (might be due to invalid IL or missing references)875			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)876			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)877			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)878			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)879			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)880			//IL_007f: Unknown result type (might be due to invalid IL or missing references)881			//IL_0081: Unknown result type (might be due to invalid IL or missing references)882			//IL_0105: Unknown result type (might be due to invalid IL or missing references)883			//IL_0107: Unknown result type (might be due to invalid IL or missing references)884			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)885			//IL_01c6: Unknown result type (might be due to invalid IL or missing references)886			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)887			//IL_0178: Unknown result type (might be due to invalid IL or missing references)888			//IL_0183: Unknown result type (might be due to invalid IL or missing references)889			//IL_0188: Unknown result type (might be due to invalid IL or missing references)890			//IL_018c: Unknown result type (might be due to invalid IL or missing references)891			//IL_0191: Unknown result type (might be due to invalid IL or missing references)892			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)893			//IL_01a8: Unknown result type (might be due to invalid IL or missing references)894			int num = _003C_003E1__state;895			DialogJobGenAssemblyBuilder dialogJobGenAssemblyBuilder = _003C_003E4__this;896			try897			{898				ConfiguredTaskAwaiter<IMetaTable> val2;899				ConfiguredTaskAwaiter<IEntityCollection> val;900				IEntityCollection result;901				IMetaTable result2;902				switch (num)903				{904				default:905				{906					IMetaData metaData = dialogJobGenAssemblyBuilder.Session.Resolve<IMetaData>();907					_003Csrc_003E5__2 = dialogJobGenAssemblyBuilder.Session.Resolve<IEntitySource>();908					val2 = metaData.GetTableAsync(query.Table.Tablename, cancellationToken).ConfigureAwait(false).GetAwaiter();909					if (!val2.IsCompleted)910					{911						num = (_003C_003E1__state = 0);912						_003C_003Eu__1 = val2;913						((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IMetaTable>, _003C_BufferObjectsAsync_003Ed__20>(ref val2, ref this);914						return;915					}916					goto IL_00b6;917				}918				case 0:919					val2 = _003C_003Eu__1;920					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<IMetaTable>);921					num = (_003C_003E1__state = -1);922					goto IL_00b6;923				case 1:924					val = _003C_003Eu__2;925					_003C_003Eu__2 = default(ConfiguredTaskAwaiter<IEntityCollection>);926					num = (_003C_003E1__state = -1);927					goto IL_013c;928				case 2:929					break;930					IL_013c:931					result = val.GetResult();932					_003C_003E7__wrap3 = ((System.Collections.Generic.IEnumerable<IEntity>)result).GetEnumerator();933					break;934					IL_00b6:935					result2 = val2.GetResult();936					_003Ctable_003E5__3 = result2;937					val = _003Csrc_003E5__2.GetCollectionAsync(query, EntityCollectionLoadType.BulkReadOnly | EntityCollectionLoadType.Slim, cancellationToken).ConfigureAwait(false).GetAwaiter();938					if (!val.IsCompleted)939					{940						num = (_003C_003E1__state = 1);941						_003C_003Eu__2 = val;942						((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntityCollection>, _003C_BufferObjectsAsync_003Ed__20>(ref val, ref this);943						return;944					}945					goto IL_013c;946				}947				try948				{949					if (num != 2)950					{951						goto IL_0200;952					}953					ConfiguredTaskAwaiter<DbObjectKey> val3 = _003C_003Eu__3;954					_003C_003Eu__3 = default(ConfiguredTaskAwaiter<DbObjectKey>);955					num = (_003C_003E1__state = -1);956					goto IL_01dd;957					IL_01dd:958					DbObjectKey result3 = val3.GetResult();959					identityMap.RegisterEternal(result3, _003Centity_003E5__5);960					_003Centity_003E5__5 = null;961					goto IL_0200;962					IL_0200:963					if (((System.Collections.IEnumerator)_003C_003E7__wrap3).MoveNext())964					{965						_003Centity_003E5__5 = _003C_003E7__wrap3.Current;966						val3 = DbObjectKey.CreateAsync(_003Ctable_003E5__3, _003Centity_003E5__5, cancellationToken).ConfigureAwait(false).GetAwaiter();967						if (!val3.IsCompleted)968						{969							num = (_003C_003E1__state = 2);970							_003C_003Eu__3 = val3;971							((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<DbObjectKey>, _003C_BufferObjectsAsync_003Ed__20>(ref val3, ref this);972							return;973						}974						goto IL_01dd;975					}976				}977				finally978				{979					if (num < 0 && _003C_003E7__wrap3 != null)980					{981						((System.IDisposable)_003C_003E7__wrap3).Dispose();982					}983				}984				_003C_003E7__wrap3 = null;985			}986			catch (System.Exception exception)987			{988				_003C_003E1__state = -2;989				_003Csrc_003E5__2 = null;990				_003Ctable_003E5__3 = null;991				((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);992				return;993			}994			_003C_003E1__state = -2;995			_003Csrc_003E5__2 = null;996			_003Ctable_003E5__3 = null;997			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();998		}9991000		[DebuggerHidden]1001		private void SetStateMachine(IAsyncStateMachine stateMachine)1002		{1003			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);1004		}1005	}10061007	[StructLayout((LayoutKind)3)]1008	[CompilerGenerated]1009	private struct _003C_GenerateChainAsync_003Ed__22 : IAsyncStateMachine1010	{1011		public int _003C_003E1__state;10121013		public AsyncTaskMethodBuilder _003C_003Et__builder;10141015		public DialogJobGenAssemblyBuilder _003C_003E4__this;10161017		public IEntity theChain;10181019		public CancellationToken ct;10201021		public IdentityMap identityMap;10221023		public StringBuilder code;10241025		private ISession _003Csession_003E5__2;10261027		private ConfiguredTaskAwaiter<IMetaTable> _003C_003Eu__1;10281029		private ConfiguredTaskAwaiter<IMetaTableRelation> _003C_003Eu__2;10301031		private ConfiguredTaskAwaiter<IEntity> _003C_003Eu__3;10321033		private ConfiguredTaskAwaiter _003C_003Eu__4;10341035		private void MoveNext()1036		{1037			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)1038			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)1039			//IL_00be: Unknown result type (might be due to invalid IL or missing references)1040			//IL_026e: Unknown result type (might be due to invalid IL or missing references)1041			//IL_0273: Unknown result type (might be due to invalid IL or missing references)1042			//IL_027b: Unknown result type (might be due to invalid IL or missing references)1043			//IL_02f6: Unknown result type (might be due to invalid IL or missing references)1044			//IL_02fb: Unknown result type (might be due to invalid IL or missing references)1045			//IL_0303: Unknown result type (might be due to invalid IL or missing references)1046			//IL_0371: Unknown result type (might be due to invalid IL or missing references)1047			//IL_0376: Unknown result type (might be due to invalid IL or missing references)1048			//IL_037e: Unknown result type (might be due to invalid IL or missing references)1049			//IL_02ad: Unknown result type (might be due to invalid IL or missing references)1050			//IL_02b8: Unknown result type (might be due to invalid IL or missing references)1051			//IL_02bd: Unknown result type (might be due to invalid IL or missing references)1052			//IL_02c1: Unknown result type (might be due to invalid IL or missing references)1053			//IL_02c6: Unknown result type (might be due to invalid IL or missing references)1054			//IL_032b: Unknown result type (might be due to invalid IL or missing references)1055			//IL_0336: Unknown result type (might be due to invalid IL or missing references)1056			//IL_033b: Unknown result type (might be due to invalid IL or missing references)1057			//IL_033f: Unknown result type (might be due to invalid IL or missing references)1058			//IL_0344: Unknown result type (might be due to invalid IL or missing references)1059			//IL_0068: Unknown result type (might be due to invalid IL or missing references)1060			//IL_0073: Unknown result type (might be due to invalid IL or missing references)1061			//IL_0078: Unknown result type (might be due to invalid IL or missing references)1062			//IL_007c: Unknown result type (might be due to invalid IL or missing references)1063			//IL_0081: Unknown result type (might be due to invalid IL or missing references)1064			//IL_02db: Unknown result type (might be due to invalid IL or missing references)1065			//IL_02dd: Unknown result type (might be due to invalid IL or missing references)1066			//IL_0359: Unknown result type (might be due to invalid IL or missing references)1067			//IL_035b: Unknown result type (might be due to invalid IL or missing references)1068			//IL_0096: Unknown result type (might be due to invalid IL or missing references)1069			//IL_0098: Unknown result type (might be due to invalid IL or missing references)1070			//IL_0225: Unknown result type (might be due to invalid IL or missing references)1071			//IL_0230: Unknown result type (might be due to invalid IL or missing references)1072			//IL_0235: Unknown result type (might be due to invalid IL or missing references)1073			//IL_0239: Unknown result type (might be due to invalid IL or missing references)1074			//IL_023e: Unknown result type (might be due to invalid IL or missing references)1075			//IL_0253: Unknown result type (might be due to invalid IL or missing references)1076			//IL_0255: Unknown result type (might be due to invalid IL or missing references)1077			int num = _003C_003E1__state;1078			DialogJobGenAssemblyBuilder dialogJobGenAssemblyBuilder = _003C_003E4__this;1079			try1080			{1081				ConfiguredTaskAwaiter<IMetaTable> val4;1082				ConfiguredTaskAwaiter<IMetaTableRelation> val3;1083				ConfiguredTaskAwaiter<IEntity> val2;1084				ConfiguredTaskAwaiter val;1085				IEntity result;1086				ConfiguredTaskAwaitable val5;1087				IMetaTableRelation result2;1088				IMetaTable result3;1089				IEntityWalker provider;1090				_ValueReplacer valueReplacer;1091				bool num2;1092				switch (num)1093				{1094				default:1095					if (!dialogJobGenAssemblyBuilder._chains.Contains(theChain.GetValue("UID_JobChain").String))1096					{1097						_003Csession_003E5__2 = dialogJobGenAssemblyBuilder.Session;1098						val4 = _003Csession_003E5__2.MetaData().GetTableAsync("JobChain", ct).ConfigureAwait(false)1099							.GetAwaiter();1100						if (!val4.IsCompleted)1101						{1102							num = (_003C_003E1__state = 0);1103							_003C_003Eu__1 = val4;1104							((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IMetaTable>, _003C_GenerateChainAsync_003Ed__22>(ref val4, ref this);1105							return;1106						}1107						goto IL_00cd;1108					}1109					goto end_IL_000e;1110				case 0:1111					val4 = _003C_003Eu__1;1112					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<IMetaTable>);1113					num = (_003C_003E1__state = -1);1114					goto IL_00cd;1115				case 1:1116					val3 = _003C_003Eu__2;1117					_003C_003Eu__2 = default(ConfiguredTaskAwaiter<IMetaTableRelation>);1118					num = (_003C_003E1__state = -1);1119					goto IL_028a;1120				case 2:1121					val2 = _003C_003Eu__3;1122					_003C_003Eu__3 = default(ConfiguredTaskAwaiter<IEntity>);1123					num = (_003C_003E1__state = -1);1124					goto IL_0312;1125				case 3:1126					{1127						val = _003C_003Eu__4;1128						_003C_003Eu__4 = default(ConfiguredTaskAwaiter);1129						num = (_003C_003E1__state = -1);1130						goto IL_038d;1131					}1132					IL_0312:1133					result = val2.GetResult();1134					val5 = dialogJobGenAssemblyBuilder._GenerateJobAsync(code, result, identityMap, ct).ConfigureAwait(false);1135					val = ((ConfiguredTaskAwaitable)(ref val5)).GetAwaiter();1136					if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)1137					{1138						num = (_003C_003E1__state = 3);1139						_003C_003Eu__4 = val;1140						((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003C_GenerateChainAsync_003Ed__22>(ref val, ref this);1141						return;1142					}1143					goto IL_038d;1144					IL_028a:1145					result2 = val3.GetResult();1146					val2 = _GetReferencedObj(_003Csession_003E5__2.Resolve<IEntitySource>(), dialogJobGenAssemblyBuilder._jobObjs, result2, theChain, ct).ConfigureAwait(false).GetAwaiter();1147					if (!val2.IsCompleted)1148					{1149						num = (_003C_003E1__state = 2);1150						_003C_003Eu__3 = val2;1151						((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntity>, _003C_GenerateChainAsync_003Ed__22>(ref val2, ref this);1152						return;1153					}1154					goto IL_0312;1155					IL_00cd:1156					result3 = val4.GetResult();1157					provider = theChain.CreateWalker(_003Csession_003E5__2, identityMap);1158					valueReplacer = new _ValueReplacer(result3, provider);1159					num2 = _TrimAll(theChain.GetValue("GenCondition").String).Length > 0;1160					code.Append(valueReplacer.Replace("Chain_Header"));1161					if (theChain.GetValue("PreCode").String.Length > 0)1162					{1163						code.Append(valueReplacer.Replace("Chain_PreCode"));1164					}1165					if (num2)1166					{1167						code.Append(valueReplacer.Replace("Chain_GenCondition_Start"));1168					}1169					if (theChain.GetValue("ProcessTracking").Int > 0)1170					{1171						code.Append(valueReplacer.Replace("Chain_ProcessTracking"));1172					}1173					code.Append(valueReplacer.Replace("Chain_Body"));1174					if (num2)1175					{1176						code.Append(valueReplacer.Replace("Chain_GenCondition_End"));1177					}1178					code.Append(valueReplacer.Replace("Chain_Footer"));1179					if (string.IsNullOrEmpty(theChain.GetValue<string>("UID_Job")))1180					{1181						break;1182					}1183					val3 = result3.Columns["UID_Job"].GetFKRelationAsync(ct).ConfigureAwait(false).GetAwaiter();1184					if (!val3.IsCompleted)1185					{1186						num = (_003C_003E1__state = 1);1187						_003C_003Eu__2 = val3;1188						((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IMetaTableRelation>, _003C_GenerateChainAsync_003Ed__22>(ref val3, ref this);1189						return;1190					}1191					goto IL_028a;1192					IL_038d:1193					((ConfiguredTaskAwaiter)(ref val)).GetResult();1194					break;1195				}1196				dialogJobGenAssemblyBuilder._chains.Add(theChain.GetValue<string>("UID_JobChain"));1197				end_IL_000e:;1198			}1199			catch (System.Exception exception)1200			{1201				_003C_003E1__state = -2;1202				_003Csession_003E5__2 = null;1203				((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);1204				return;1205			}1206			_003C_003E1__state = -2;1207			_003Csession_003E5__2 = null;1208			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();1209		}12101211		[DebuggerHidden]1212		private void SetStateMachine(IAsyncStateMachine stateMachine)1213		{1214			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);1215		}1216	}12171218	[StructLayout((LayoutKind)3)]1219	[CompilerGenerated]1220	private struct _003C_GenerateEventsAsync_003Ed__21 : IAsyncStateMachine1221	{1222		public int _003C_003E1__state;12231224		public AsyncTaskMethodBuilder<bool> _003C_003Et__builder;12251226		public DialogJobGenAssemblyBuilder _003C_003E4__this;12271228		public CancellationToken ct;12291230		private _003C_003Ec__DisplayClass21_0 _003C_003E8__1;12311232		public IdentityMap identityMap;12331234		public StringBuilder code;12351236		private string _003Cfooter_003E5__2;12371238		private string _003CeventName_003E5__3;12391240		private SortedList<string, IEntity> _003Cchains_003E5__4;12411242		private ISqlFormatter _003Cf_003E5__5;12431244		private ISession _003Csession_003E5__6;12451246		private IMetaTable _003CjobEventGenTable_003E5__7;12471248		private IMetaTable _003CqbmEventTable_003E5__8;12491250		private ConfiguredTaskAwaiter<IMetaTable> _003C_003Eu__1;12511252		private ConfiguredTaskAwaiter<IEntityCollection> _003C_003Eu__2;12531254		private System.Collections.Generic.IEnumerator<global::_003C_003Ef__AnonymousType0<IEntity, IEntity>> _003C_003E7__wrap8;12551256		private global::_003C_003Ef__AnonymousType0<IEntity, IEntity> _003Cevt_003E5__10;12571258		private DbObjectKey _003CkeyJobGenEvent_003E5__11;12591260		private IEntityWalker _003Cwalker_003E5__12;12611262		private _ValueReplacer _003Crep_003E5__13;12631264		private bool _003Cenabled_003E5__14;12651266		private ConfiguredTaskAwaiter<DbObjectKey> _003C_003Eu__3;12671268		private object _003C_003E7__wrap14;12691270		private int _003C_003E7__wrap15;12711272		private ConfiguredValueTaskAwaiter<string> _003C_003Eu__4;12731274		private ScriptError _003C_003E7__wrap16;12751276		private ScriptError _003C_003E7__wrap17;12771278		private IEntitySource _003C_003E7__wrap18;12791280		private Dictionary<DbObjectKey, IEntity> _003C_003E7__wrap19;12811282		private ConfiguredTaskAwaiter<IMetaTableRelation> _003C_003Eu__5;12831284		private ConfiguredTaskAwaiter<IEntity> _003C_003Eu__6;12851286		private System.Collections.Generic.IEnumerator<IEntity> _003C_003E7__wrap20;12871288		private ConfiguredTaskAwaiter _003C_003Eu__7;12891290		private void MoveNext()1291		{1292			//IL_00df: Unknown result type (might be due to invalid IL or missing references)1293			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)1294			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)1295			//IL_0166: Unknown result type (might be due to invalid IL or missing references)1296			//IL_016b: Unknown result type (might be due to invalid IL or missing references)1297			//IL_0173: Unknown result type (might be due to invalid IL or missing references)1298			//IL_0296: Unknown result type (might be due to invalid IL or missing references)1299			//IL_029b: Unknown result type (might be due to invalid IL or missing references)1300			//IL_02a3: Unknown result type (might be due to invalid IL or missing references)1301			//IL_034b: Unknown result type (might be due to invalid IL or missing references)1302			//IL_0350: Unknown result type (might be due to invalid IL or missing references)1303			//IL_0358: Unknown result type (might be due to invalid IL or missing references)1304			//IL_0096: Unknown result type (might be due to invalid IL or missing references)1305			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)1306			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)1307			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)1308			//IL_00af: Unknown result type (might be due to invalid IL or missing references)1309			//IL_07e1: Unknown result type (might be due to invalid IL or missing references)1310			//IL_07ec: Unknown result type (might be due to invalid IL or missing references)1311			//IL_07f1: Unknown result type (might be due to invalid IL or missing references)1312			//IL_07f5: Unknown result type (might be due to invalid IL or missing references)1313			//IL_07fa: Unknown result type (might be due to invalid IL or missing references)1314			//IL_011d: Unknown result type (might be due to invalid IL or missing references)1315			//IL_0128: Unknown result type (might be due to invalid IL or missing references)1316			//IL_012d: Unknown result type (might be due to invalid IL or missing references)1317			//IL_0131: Unknown result type (might be due to invalid IL or missing references)1318			//IL_0136: Unknown result type (might be due to invalid IL or missing references)1319			//IL_0302: Unknown result type (might be due to invalid IL or missing references)1320			//IL_030d: Unknown result type (might be due to invalid IL or missing references)1321			//IL_0312: Unknown result type (might be due to invalid IL or missing references)1322			//IL_0316: Unknown result type (might be due to invalid IL or missing references)1323			//IL_031b: Unknown result type (might be due to invalid IL or missing references)1324			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)1325			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)1326			//IL_080f: Unknown result type (might be due to invalid IL or missing references)1327			//IL_0811: Unknown result type (might be due to invalid IL or missing references)1328			//IL_014b: Unknown result type (might be due to invalid IL or missing references)1329			//IL_014d: Unknown result type (might be due to invalid IL or missing references)1330			//IL_0330: Unknown result type (might be due to invalid IL or missing references)1331			//IL_0332: Unknown result type (might be due to invalid IL or missing references)1332			//IL_04d9: Unknown result type (might be due to invalid IL or missing references)1333			//IL_04de: Unknown result type (might be due to invalid IL or missing references)1334			//IL_04e6: Unknown result type (might be due to invalid IL or missing references)1335			//IL_0561: Unknown result type (might be due to invalid IL or missing references)1336			//IL_0566: Unknown result type (might be due to invalid IL or missing references)1337			//IL_056e: Unknown result type (might be due to invalid IL or missing references)1338			//IL_082a: Unknown result type (might be due to invalid IL or missing references)1339			//IL_082f: Unknown result type (might be due to invalid IL or missing references)1340			//IL_0837: Unknown result type (might be due to invalid IL or missing references)1341			//IL_09c8: Unknown result type (might be due to invalid IL or missing references)1342			//IL_09cd: Unknown result type (might be due to invalid IL or missing references)1343			//IL_09d5: Unknown result type (might be due to invalid IL or missing references)1344			//IL_0a51: Unknown result type (might be due to invalid IL or missing references)1345			//IL_0a56: Unknown result type (might be due to invalid IL or missing references)1346			//IL_0a5e: Unknown result type (might be due to invalid IL or missing references)1347			//IL_0baf: Unknown result type (might be due to invalid IL or missing references)1348			//IL_0bb4: Unknown result type (might be due to invalid IL or missing references)1349			//IL_0bbc: Unknown result type (might be due to invalid IL or missing references)1350			//IL_097f: Unknown result type (might be due to invalid IL or missing references)1351			//IL_098a: Unknown result type (might be due to invalid IL or missing references)1352			//IL_098f: Unknown result type (might be due to invalid IL or missing references)1353			//IL_0993: Unknown result type (might be due to invalid IL or missing references)1354			//IL_0998: Unknown result type (might be due to invalid IL or missing references)1355			//IL_024d: Unknown result type (might be due to invalid IL or missing references)1356			//IL_0258: Unknown result type (might be due to invalid IL or missing references)1357			//IL_025d: Unknown result type (might be due to invalid IL or missing references)1358			//IL_0261: Unknown result type (might be due to invalid IL or missing references)1359			//IL_0266: Unknown result type (might be due to invalid IL or missing references)1360			//IL_0518: Unknown result type (might be due to invalid IL or missing references)1361			//IL_0523: Unknown result type (might be due to invalid IL or missing references)1362			//IL_0528: Unknown result type (might be due to invalid IL or missing references)1363			//IL_052c: Unknown result type (might be due to invalid IL or missing references)1364			//IL_0531: Unknown result type (might be due to invalid IL or missing references)1365			//IL_0a07: Unknown result type (might be due to invalid IL or missing references)1366			//IL_0a12: Unknown result type (might be due to invalid IL or missing references)1367			//IL_0a17: Unknown result type (might be due to invalid IL or missing references)1368			//IL_0a1b: Unknown result type (might be due to invalid IL or missing references)1369			//IL_0a20: Unknown result type (might be due to invalid IL or missing references)1370			//IL_0490: Unknown result type (might be due to invalid IL or missing references)1371			//IL_049b: Unknown result type (might be due to invalid IL or missing references)1372			//IL_04a0: Unknown result type (might be due to invalid IL or missing references)1373			//IL_04a4: Unknown result type (might be due to invalid IL or missing references)1374			//IL_04a9: Unknown result type (might be due to invalid IL or missing references)1375			//IL_09ad: Unknown result type (might be due to invalid IL or missing references)1376			//IL_09af: Unknown result type (might be due to invalid IL or missing references)1377			//IL_027b: Unknown result type (might be due to invalid IL or missing references)1378			//IL_027d: Unknown result type (might be due to invalid IL or missing references)1379			//IL_0546: Unknown result type (might be due to invalid IL or missing references)1380			//IL_0548: Unknown result type (might be due to invalid IL or missing references)1381			//IL_06d3: Unknown result type (might be due to invalid IL or missing references)1382			//IL_06d8: Unknown result type (might be due to invalid IL or missing references)1383			//IL_06e0: Unknown result type (might be due to invalid IL or missing references)1384			//IL_0686: Unknown result type (might be due to invalid IL or missing references)1385			//IL_0695: Unknown result type (might be due to invalid IL or missing references)1386			//IL_069a: Unknown result type (might be due to invalid IL or missing references)1387			//IL_069e: Unknown result type (might be due to invalid IL or missing references)1388			//IL_06a3: Unknown result type (might be due to invalid IL or missing references)1389			//IL_0a36: Unknown result type (might be due to invalid IL or missing references)1390			//IL_0a38: Unknown result type (might be due to invalid IL or missing references)1391			//IL_0b65: Unknown result type (might be due to invalid IL or missing references)1392			//IL_0b70: Unknown result type (might be due to invalid IL or missing references)1393			//IL_0b75: Unknown result type (might be due to invalid IL or missing references)1394			//IL_0b79: Unknown result type (might be due to invalid IL or missing references)1395			//IL_0b7e: Unknown result type (might be due to invalid IL or missing references)1396			//IL_04be: Unknown result type (might be due to invalid IL or missing references)1397			//IL_04c0: Unknown result type (might be due to invalid IL or missing references)1398			//IL_06b8: Unknown result type (might be due to invalid IL or missing references)1399			//IL_06ba: Unknown result type (might be due to invalid IL or missing references)1400			//IL_0b94: Unknown result type (might be due to invalid IL or missing references)1401			//IL_0b96: Unknown result type (might be due to invalid IL or missing references)1402			int num = _003C_003E1__state;1403			DialogJobGenAssemblyBuilder dialogJobGenAssemblyBuilder = _003C_003E4__this;1404			bool result8;1405			try1406			{1407				ConfiguredTaskAwaiter<IMetaTable> val2;1408				ConfiguredTaskAwaiter<IEntityCollection> val;1409				IOrderedEnumerable<global::_003C_003Ef__AnonymousType0<IEntity, IEntity>> val7;1410				IMetaTable result6;1411				ISelect obj;1412				ISqlFormatter sqlFormatter;1413				string[] obj2;1414				object obj3;1415				Query query;1416				IEntityCollection result7;1417				Query query2;1418				switch (num)1419				{1420				default:1421					_003C_003E8__1 = new _003C_003Ec__DisplayClass21_0();1422					_003Cfooter_003E5__2 = null;1423					_003CeventName_003E5__3 = "";1424					_003Cchains_003E5__4 = new SortedList<string, IEntity>();1425					_003Cf_003E5__5 = dialogJobGenAssemblyBuilder.Session.SqlFormatter();1426					_003Csession_003E5__6 = dialogJobGenAssemblyBuilder.Session;1427					val2 = _003Csession_003E5__6.MetaData().GetTableAsync("JobEventGen", ct).ConfigureAwait(false)1428						.GetAwaiter();1429					if (!val2.IsCompleted)1430					{1431						num = (_003C_003E1__state = 0);1432						_003C_003Eu__1 = val2;1433						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IMetaTable>, _003C_GenerateEventsAsync_003Ed__21>(ref val2, ref this);1434						return;1435					}1436					goto IL_00fb;1437				case 0:1438					val2 = _003C_003Eu__1;1439					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<IMetaTable>);1440					num = (_003C_003E1__state = -1);1441					goto IL_00fb;1442				case 1:1443					val2 = _003C_003Eu__1;1444					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<IMetaTable>);1445					num = (_003C_003E1__state = -1);1446					goto IL_0182;1447				case 2:1448					val = _003C_003Eu__2;1449					_003C_003Eu__2 = default(ConfiguredTaskAwaiter<IEntityCollection>);1450					num = (_003C_003E1__state = -1);1451					goto IL_02b2;1452				case 3:1453					val = _003C_003Eu__2;1454					_003C_003Eu__2 = default(ConfiguredTaskAwaiter<IEntityCollection>);1455					num = (_003C_003E1__state = -1);1456					goto IL_0367;1457				case 4:1458				case 5:1459				case 6:1460				case 7:1461				case 8:1462				case 9:1463					try1464					{1465						ConfiguredTaskAwaiter<DbObjectKey> val5;1466						ConfiguredTaskAwaiter<IMetaTableRelation> val4;1467						ConfiguredTaskAwaiter<IEntity> val3;1468						IMetaTableRelation result2;1469						DbObjectKey result3;1470						string value;1471						DbObjectKey result;1472						ScriptError scriptError;1473						IEntity result4;1474						IEntity entity;1475						switch (num)1476						{1477						case 4:1478							val5 = _003C_003Eu__3;1479							_003C_003Eu__3 = default(ConfiguredTaskAwaiter<DbObjectKey>);1480							num = (_003C_003E1__state = -1);1481							goto IL_04f5;1482						case 5:1483							val5 = _003C_003Eu__3;1484							_003C_003Eu__3 = default(ConfiguredTaskAwaiter<DbObjectKey>);1485							num = (_003C_003E1__state = -1);1486							goto IL_057d;1487						case 6:1488						{1489							try1490							{1491								ConfiguredValueTaskAwaiter<string> val6;1492								if (num != 6)1493								{1494									val6 = _003Cwalker_003E5__12.GetValueAsync<string>("FK(UID_JobChain).PreprocessorCondition", ct).ConfigureAwait(false).GetAwaiter();1495									if (!val6.IsCompleted)1496									{1497										num = (_003C_003E1__state = 6);1498										_003C_003Eu__4 = val6;1499										_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<string>, _003C_GenerateEventsAsync_003Ed__21>(ref val6, ref this);1500										return;1501									}1502								}1503								else1504								{1505									val6 = _003C_003Eu__4;1506									_003C_003Eu__4 = default(ConfiguredValueTaskAwaiter<string>);1507									num = (_003C_003E1__state = -1);1508								}1509								string result5 = val6.GetResult();1510								_003Cenabled_003E5__14 = dialogJobGenAssemblyBuilder._ParseExpression(result5);1511							}1512							catch (System.Exception ex)1513							{1514								_003C_003E7__wrap14 = ex;1515								_003C_003E7__wrap15 = 1;1516							}1517							int num2 = _003C_003E7__wrap15;1518							if (num2 == 1)1519							{1520								System.Exception ex2 = (System.Exception)_003C_003E7__wrap14;1521								_003C_003E7__wrap17 = new ScriptError();1522								_003C_003E7__wrap17.Column = 0;1523								ScriptError scriptError2 = _003C_003E7__wrap17;1524								LanguageManager instance = LanguageManager.Instance;1525								object value2 = _003Cwalker_003E5__12.GetValue<string>("FK(UID_JobChain).Name");1526								scriptError2.ErrorText = instance.FormatString("strError810147", new System.ReadOnlySpan<object>(ref value2)) + " " + ex2.Message;1527								_003C_003E7__wrap17.FileName = "Unknown File";1528								_003C_003E7__wrap17.Line = 1;1529								_003C_003E7__wrap16 = _003C_003E7__wrap17;1530								val5 = DbObjectKey.CreateAsync(_003CjobEventGenTable_003E5__7.Columns["UID_JobChain"].GetFKRelation(), _003Cevt_003E5__10.JobEventGen, ct).ConfigureAwait(false).GetAwaiter();1531								if (!val5.IsCompleted)1532								{1533									num = (_003C_003E1__state = 7);1534									_003C_003Eu__3 = val5;1535									_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<DbObjectKey>, _003C_GenerateEventsAsync_003Ed__21>(ref val5, ref this);1536									return;1537								}1538								goto IL_0846;1539							}1540							_003C_003E7__wrap14 = null;1541							if (_003Cenabled_003E5__14)1542							{1543								code.Append(_003Crep_003E5__13.Replace("Event_Chain"));1544								if (!string.IsNullOrEmpty(_003Cevt_003E5__10.JobEventGen.GetValue("ProcessDisplay").String))1545								{1546									code.Append(_003Crep_003E5__13.Replace("Event_ProcessTracking"));1547								}1548								code.Append(_003Crep_003E5__13.Replace("Event_EndChain"));1549								_003C_003E7__wrap18 = _003Csession_003E5__6.Resolve<IEntitySource>();1550								_003C_003E7__wrap19 = dialogJobGenAssemblyBuilder._chainObjs;1551								val4 = _003CjobEventGenTable_003E5__7.Columns["UID_JobChain"].GetFKRelationAsync(ct).ConfigureAwait(false).GetAwaiter();1552								if (!val4.IsCompleted)1553								{1554									num = (_003C_003E1__state = 8);1555									_003C_003Eu__5 = val4;1556									_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IMetaTableRelation>, _003C_GenerateEventsAsync_003Ed__21>(ref val4, ref this);1557									return;1558								}1559								goto IL_09e4;1560							}1561							goto IL_0ac0;1562						}1563						case 7:1564							val5 = _003C_003Eu__3;1565							_003C_003Eu__3 = default(ConfiguredTaskAwaiter<DbObjectKey>);1566							num = (_003C_003E1__state = -1);1567							goto IL_0846;1568						case 8:1569							val4 = _003C_003Eu__5;1570							_003C_003Eu__5 = default(ConfiguredTaskAwaiter<IMetaTableRelation>);1571							num = (_003C_003E1__state = -1);1572							goto IL_09e4;1573						case 9:1574							val3 = _003C_003Eu__6;1575							_003C_003Eu__6 = default(ConfiguredTaskAwaiter<IEntity>);1576							num = (_003C_003E1__state = -1);1577							goto IL_0a6d;1578						default:1579							{1580								if (((System.Collections.IEnumerator)_003C_003E7__wrap8).MoveNext())1581								{1582									_003Cevt_003E5__10 = _003C_003E7__wrap8.Current;1583									val5 = DbObjectKey.CreateAsync(_003CjobEventGenTable_003E5__7, _003Cevt_003E5__10.JobEventGen, ct).ConfigureAwait(false).GetAwaiter();1584									if (!val5.IsCompleted)1585									{1586										num = (_003C_003E1__state = 4);1587										_003C_003Eu__3 = val5;1588										_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<DbObjectKey>, _003C_GenerateEventsAsync_003Ed__21>(ref val5, ref this);1589										return;1590									}1591									goto IL_04f5;1592								}1593								break;1594							}1595							IL_04f5:1596							result = val5.GetResult();1597							_003CkeyJobGenEvent_003E5__11 = result;1598							val5 = DbObjectKey.CreateAsync(_003CqbmEventTable_003E5__8, _003Cevt_003E5__10.QBMEvent, ct).ConfigureAwait(false).GetAwaiter();1599							if (!val5.IsCompleted)1600							{1601								num = (_003C_003E1__state = 5);1602								_003C_003Eu__3 = val5;1603								_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<DbObjectKey>, _003C_GenerateEventsAsync_003Ed__21>(ref val5, ref this);1604								return;1605							}1606							goto IL_057d;1607							IL_09e4:1608							result2 = val4.GetResult();1609							val3 = _GetReferencedObj(_003C_003E7__wrap18, _003C_003E7__wrap19, result2, _003Cevt_003E5__10.JobEventGen, ct).ConfigureAwait(false).GetAwaiter();1610							if (!val3.IsCompleted)1611							{1612								num = (_003C_003E1__state = 9);1613								_003C_003Eu__6 = val3;1614								_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntity>, _003C_GenerateEventsAsync_003Ed__21>(ref val3, ref this);1615								return;1616							}1617							goto IL_0a6d;1618							IL_057d:1619							result3 = val5.GetResult();1620							identityMap.RegisterEternal(_003CkeyJobGenEvent_003E5__11, _003Cevt_003E5__10.JobEventGen);1621							identityMap.RegisterEternal(result3, _003Cevt_003E5__10.QBMEvent);1622							_003Cwalker_003E5__12 = _003Cevt_003E5__10.JobEventGen.CreateWalker(_003Csession_003E5__6, identityMap);1623							_003Crep_003E5__13 = new _ValueReplacer(_003CjobEventGenTable_003E5__7, _003Cwalker_003E5__12);1624							value = _003Cevt_003E5__10.QBMEvent.GetValue<string>("EventName");1625							if (!string.Equals(value, _003CeventName_003E5__3, (StringComparison)5))1626							{1627								if (_003Cfooter_003E5__2 != null)1628								{1629									code.Append(_003Cfooter_003E5__2);1630								}1631								_003CeventName_003E5__3 = value;1632								code.Append(_003Crep_003E5__13.Replace("Event_Header"));1633								_003Cfooter_003E5__2 = _003Crep_003E5__13.Replace("Event_Footer");1634							}1635							_003C_003E7__wrap15 = 0;1636							goto case 6;1637							IL_0ac0:1638							_003CkeyJobGenEvent_003E5__11 = null;1639							_003Cwalker_003E5__12 = null;1640							_003Crep_003E5__13 = null;1641							_003Cevt_003E5__10 = null;1642							goto default;1643							IL_0846:1644							result = val5.GetResult();1645							_003C_003E7__wrap16.ObjectKey = result;1646							_003C_003E7__wrap17.ScriptLine = 1;1647							_003C_003E7__wrap17.ScriptName = "PreprocessorCondition of job " + _003Cwalker_003E5__12.GetValue<string>("FK(UID_JobChain).Name");1648							scriptError = _003C_003E7__wrap17;1649							_003C_003E7__wrap16 = null;1650							_003C_003E7__wrap17 = null;1651							throw new ScriptCompileException(new ScriptError[1] { scriptError }, _003Cwalker_003E5__12.GetValue<string>("FK(UID_JobChain).PreprocessorCondition"));1652							IL_0a6d:1653							result4 = val3.GetResult();1654							_003C_003E7__wrap18 = null;1655							_003C_003E7__wrap19 = null;1656							entity = result4;1657							if (!_003Cchains_003E5__4.ContainsKey(entity.GetValue("Name").String))1658							{1659								_003Cchains_003E5__4.Add(entity.GetValue("Name").String, entity);1660							}1661							goto IL_0ac0;1662						}1663					}1664					finally1665					{1666						if (num < 0 && _003C_003E7__wrap8 != null)1667						{1668							((System.IDisposable)_003C_003E7__wrap8).Dispose();1669						}1670					}1671					_003C_003E7__wrap8 = null;1672					if (_003Cfooter_003E5__2 != null)1673					{1674						code.Append(_003Cfooter_003E5__2);1675					}1676					_003C_003E7__wrap20 = ((System.Collections.Generic.IEnumerable<IEntity>)_003Cchains_003E5__4.Values).GetEnumerator();1677					break;1678				case 10:1679					break;1680					IL_00fb:1681					result6 = val2.GetResult();1682					_003CjobEventGenTable_003E5__7 = result6;1683					val2 = _003Csession_003E5__6.MetaData().GetTableAsync("QBMEvent", ct).ConfigureAwait(false)1684						.GetAwaiter();1685					if (!val2.IsCompleted)1686					{1687						num = (_003C_003E1__state = 1);1688						_003C_003Eu__1 = val2;1689						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IMetaTable>, _003C_GenerateEventsAsync_003Ed__21>(ref val2, ref this);1690						return;1691					}1692					goto IL_0182;1693					IL_0367:1694					result7 = val.GetResult();1695					_003C_003E8__1.qbmEvents = Enumerable.ToDictionary<IEntity, string>((System.Collections.Generic.IEnumerable<IEntity>)result7, (Func<IEntity, string>)((IEntity e) => e.GetValue<string>("UID_QBMEvent")), (IEqualityComparer<string>)(object)StringComparer.Ordinal);1696					val7 = Enumerable.ThenBy(Enumerable.OrderBy(Enumerable.Where(Enumerable.Select((System.Collections.Generic.IEnumerable<IEntity>)_003C_003E8__1.jobEventGens, delegate(IEntity e)1697					{1698						IEntity qBMEvent = default(IEntity);1699						_003C_003E8__1.qbmEvents.TryGetValue(e.GetValue<string>("UID_QBMEvent"), ref qBMEvent);1700						return new1701						{1702							JobEventGen = e,1703							QBMEvent = qBMEvent1704						};1705					}), e => e.QBMEvent != null), e => e.QBMEvent.GetValue<string>("EventName"), (IComparer<string>)(object)StringComparer.OrdinalIgnoreCase), e => e.JobEventGen.GetValue<int>("OrderNr"));1706					_003C_003E7__wrap8 = ((System.Collections.Generic.IEnumerable<global::_003C_003Ef__AnonymousType0<IEntity, IEntity>>)val7).GetEnumerator();1707					goto case 4;1708					IL_0182:1709					result6 = val2.GetResult();1710					_003CqbmEventTable_003E5__8 = result6;1711					obj = Query.From("JobEventGen").Where(string.Format("exists (select 1 from QBMEvent e where e.UID_QBMEvent = JobEventGen.UID_QBMEvent and {0})", (object)_003Cf_003E5__5.UidComparison("e.UID_DialogTable", dialogJobGenAssemblyBuilder.Table.Uid)));1712					sqlFormatter = _003Cf_003E5__5;1713					obj2 = new string[2]1714					{1715						_003Cf_003E5__5.Comparison("JobChain.NoGenerate", false, ValType.Bool),1716						null1717					};1718					if (dialogJobGenAssemblyBuilder.UidsOfChainsToInclude == null || dialogJobGenAssemblyBuilder.UidsOfChainsToInclude.Length == 0)1719					{1720						obj3 = null;1721					}1722					else1723					{1724						ISqlFormatter sqlFormatter2 = _003Cf_003E5__5;1725						object[] uidsOfChainsToInclude = dialogJobGenAssemblyBuilder.UidsOfChainsToInclude;1726						obj3 = sqlFormatter2.InClause("jobchain.uid_jobchain", ValType.String, FormatterOptions.NonUnicodeLiterals, uidsOfChainsToInclude);1727					}1728					obj2[1] = (string)obj3;1729					query = obj.Where($"exists ( select name from jobchain where jobchain.uid_jobchain = jobeventgen.uid_jobchain and {sqlFormatter.AndRelation(obj2)})").SelectNonLobs();1730					val = _003Csession_003E5__6.Resolve<IEntitySource>().GetCollectionAsync(query, EntityCollectionLoadType.BulkReadOnly | EntityCollectionLoadType.Slim, ct).ConfigureAwait(false)1731						.GetAwaiter();1732					if (!val.IsCompleted)1733					{1734						num = (_003C_003E1__state = 2);1735						_003C_003Eu__2 = val;1736						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntityCollection>, _003C_GenerateEventsAsync_003Ed__21>(ref val, ref this);1737						return;1738					}1739					goto IL_02b2;1740					IL_02b2:1741					result7 = val.GetResult();1742					_003C_003E8__1.jobEventGens = result7;1743					query2 = (from t in Query.From("QBMEvent")1744						where t.Column("UID_QBMEvent").In(Enumerable.Select<IEntity, string>((System.Collections.Generic.IEnumerable<IEntity>)_003C_003E8__1.jobEventGens, (Func<IEntity, string>)((IEntity e) => e.GetValue<string>("UID_QBMEvent"))))1745						select t).SelectNonLobs();1746					val = _003Csession_003E5__6.Resolve<IEntitySource>().GetCollectionAsync(query2, EntityCollectionLoadType.BulkReadOnly | EntityCollectionLoadType.Slim, ct).ConfigureAwait(false)1747						.GetAwaiter();1748					if (!val.IsCompleted)1749					{1750						num = (_003C_003E1__state = 3);1751						_003C_003Eu__2 = val;1752						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntityCollection>, _003C_GenerateEventsAsync_003Ed__21>(ref val, ref this);1753						return;1754					}1755					goto IL_0367;1756				}1757				try1758				{1759					if (num != 10)1760					{1761						goto IL_0bd2;1762					}1763					ConfiguredTaskAwaiter val8 = _003C_003Eu__7;1764					_003C_003Eu__7 = default(ConfiguredTaskAwaiter);1765					num = (_003C_003E1__state = -1);1766					goto IL_0bcb;1767					IL_0bcb:1768					((ConfiguredTaskAwaiter)(ref val8)).GetResult();1769					goto IL_0bd2;1770					IL_0bd2:1771					if (((System.Collections.IEnumerator)_003C_003E7__wrap20).MoveNext())1772					{1773						IEntity current = _003C_003E7__wrap20.Current;1774						ConfiguredTaskAwaitable val9 = dialogJobGenAssemblyBuilder._GenerateChainAsync(code, current, identityMap, ct).ConfigureAwait(false);1775						val8 = ((ConfiguredTaskAwaitable)(ref val9)).GetAwaiter();1776						if (!((ConfiguredTaskAwaiter)(ref val8)).IsCompleted)1777						{1778							num = (_003C_003E1__state = 10);1779							_003C_003Eu__7 = val8;1780							_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003C_GenerateEventsAsync_003Ed__21>(ref val8, ref this);1781							return;1782						}1783						goto IL_0bcb;1784					}1785				}1786				finally1787				{1788					if (num < 0 && _003C_003E7__wrap20 != null)1789					{1790						((System.IDisposable)_003C_003E7__wrap20).Dispose();1791					}1792				}1793				_003C_003E7__wrap20 = null;1794				result8 = _003Cchains_003E5__4.Count > 0;1795			}1796			catch (System.Exception exception)1797			{1798				_003C_003E1__state = -2;1799				_003C_003Et__builder.SetException(exception);1800				return;1801			}1802			_003C_003E1__state = -2;1803			_003C_003Et__builder.SetResult(result8);1804		}18051806		[DebuggerHidden]1807		private void SetStateMachine(IAsyncStateMachine stateMachine)1808		{1809			_003C_003Et__builder.SetStateMachine(stateMachine);1810		}1811	}18121813	[StructLayout((LayoutKind)3)]1814	[CompilerGenerated]1815	private struct _003C_GenerateJobAsync_003Ed__23 : IAsyncStateMachine1816	{1817		public int _003C_003E1__state;18181819		public AsyncTaskMethodBuilder _003C_003Et__builder;18201821		public DialogJobGenAssemblyBuilder _003C_003E4__this;18221823		public IEntity theJob;18241825		public CancellationToken ct;18261827		public IdentityMap identityMap;18281829		public StringBuilder code;18301831		private _003C_003Ec__DisplayClass23_0 _003C_003E8__1;18321833		private ISession _003Csession_003E5__2;18341835		private _ValueReplacer _003Crep_003E5__3;18361837		private bool _003ChasCondition_003E5__4;18381839		private bool _003ChasPreproc_003E5__5;18401841		private string _003CuidSuccessor_003E5__6;18421843		private string _003CuidError_003E5__7;18441845		private ConfiguredTaskAwaiter<IMetaTable> _003C_003Eu__1;18461847		private ConfiguredTaskAwaiter<IEntity> _003C_003Eu__2;18481849		private ConfiguredTaskAwaiter _003C_003Eu__3;18501851		private void MoveNext()1852		{1853			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)1854			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)1855			//IL_0103: Unknown result type (might be due to invalid IL or missing references)1856			//IL_0450: Unknown result type (might be due to invalid IL or missing references)1857			//IL_0455: Unknown result type (might be due to invalid IL or missing references)1858			//IL_045d: Unknown result type (might be due to invalid IL or missing references)1859			//IL_094f: Unknown result type (might be due to invalid IL or missing references)1860			//IL_0954: Unknown result type (might be due to invalid IL or missing references)1861			//IL_095c: Unknown result type (might be due to invalid IL or missing references)1862			//IL_09cd: Unknown result type (might be due to invalid IL or missing references)1863			//IL_09d2: Unknown result type (might be due to invalid IL or missing references)1864			//IL_09da: Unknown result type (might be due to invalid IL or missing references)1865			//IL_0a6f: Unknown result type (might be due to invalid IL or missing references)1866			//IL_0a74: Unknown result type (might be due to invalid IL or missing references)1867			//IL_0a7c: Unknown result type (might be due to invalid IL or missing references)1868			//IL_0aed: Unknown result type (might be due to invalid IL or missing references)1869			//IL_0af2: Unknown result type (might be due to invalid IL or missing references)1870			//IL_0afa: Unknown result type (might be due to invalid IL or missing references)1871			//IL_0984: Unknown result type (might be due to invalid IL or missing references)1872			//IL_098f: Unknown result type (might be due to invalid IL or missing references)1873			//IL_0994: Unknown result type (might be due to invalid IL or missing references)1874			//IL_0998: Unknown result type (might be due to invalid IL or missing references)1875			//IL_099d: Unknown result type (might be due to invalid IL or missing references)1876			//IL_0aa4: Unknown result type (might be due to invalid IL or missing references)1877			//IL_0aaf: Unknown result type (might be due to invalid IL or missing references)1878			//IL_0ab4: Unknown result type (might be due to invalid IL or missing references)1879			//IL_0ab8: Unknown result type (might be due to invalid IL or missing references)1880			//IL_0abd: Unknown result type (might be due to invalid IL or missing references)1881			//IL_09b2: Unknown result type (might be due to invalid IL or missing references)1882			//IL_09b4: Unknown result type (might be due to invalid IL or missing references)1883			//IL_0ad2: Unknown result type (might be due to invalid IL or missing references)1884			//IL_0ad4: Unknown result type (might be due to invalid IL or missing references)1885			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)1886			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)1887			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)1888			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)1889			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)1890			//IL_0a26: Unknown result type (might be due to invalid IL or missing references)1891			//IL_0a31: Unknown result type (might be due to invalid IL or missing references)1892			//IL_0a36: Unknown result type (might be due to invalid IL or missing references)1893			//IL_0a3a: Unknown result type (might be due to invalid IL or missing references)1894			//IL_0a3f: Unknown result type (might be due to invalid IL or missing references)1895			//IL_00db: Unknown result type (might be due to invalid IL or missing references)1896			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)1897			//IL_0a54: Unknown result type (might be due to invalid IL or missing references)1898			//IL_0a56: Unknown result type (might be due to invalid IL or missing references)1899			//IL_0407: Unknown result type (might be due to invalid IL or missing references)1900			//IL_0412: Unknown result type (might be due to invalid IL or missing references)1901			//IL_0417: Unknown result type (might be due to invalid IL or missing references)1902			//IL_041b: Unknown result type (might be due to invalid IL or missing references)1903			//IL_0420: Unknown result type (might be due to invalid IL or missing references)1904			//IL_0435: Unknown result type (might be due to invalid IL or missing references)1905			//IL_0437: Unknown result type (might be due to invalid IL or missing references)1906			//IL_0906: Unknown result type (might be due to invalid IL or missing references)1907			//IL_0911: Unknown result type (might be due to invalid IL or missing references)1908			//IL_0916: Unknown result type (might be due to invalid IL or missing references)1909			//IL_091a: Unknown result type (might be due to invalid IL or missing references)1910			//IL_091f: Unknown result type (might be due to invalid IL or missing references)1911			//IL_0934: Unknown result type (might be due to invalid IL or missing references)1912			//IL_0936: Unknown result type (might be due to invalid IL or missing references)1913			int num = _003C_003E1__state;1914			DialogJobGenAssemblyBuilder dialogJobGenAssemblyBuilder = _003C_003E4__this;1915			try1916			{1917				ConfiguredTaskAwaiter<IMetaTable> val3;1918				ConfiguredTaskAwaiter val;1919				ConfiguredTaskAwaiter<IEntity> val2;1920				IEntity result;1921				ConfiguredTaskAwaitable val4;1922				IEntity result2;1923				IMetaTable result3;1924				IEntityWalker provider;1925				IMetaTable result4;1926				System.Collections.Generic.IEnumerator<IEntity> enumerator;1927				switch (num)1928				{1929				default:1930					_003C_003E8__1 = new _003C_003Ec__DisplayClass23_0();1931					if (!dialogJobGenAssemblyBuilder._jobs.Contains(theJob.GetValue<string>("UID_Job")))1932					{1933						if (DbVal.IsEmpty(theJob.GetRaw("UID_Jobtask"), ValType.String))1934						{1935							throw new ViException(57335004, theJob.Display);1936						}1937						_003Csession_003E5__2 = dialogJobGenAssemblyBuilder.Session;1938						val3 = _003Csession_003E5__2.MetaData().GetTableAsync("Job", ct).ConfigureAwait(false)1939							.GetAwaiter();1940						if (!val3.IsCompleted)1941						{1942							num = (_003C_003E1__state = 0);1943							_003C_003Eu__1 = val3;1944							((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IMetaTable>, _003C_GenerateJobAsync_003Ed__23>(ref val3, ref this);1945							return;1946						}1947						goto IL_0112;1948					}1949					goto end_IL_000e;1950				case 0:1951					val3 = _003C_003Eu__1;1952					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<IMetaTable>);1953					num = (_003C_003E1__state = -1);1954					goto IL_0112;1955				case 1:1956					val3 = _003C_003Eu__1;1957					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<IMetaTable>);1958					num = (_003C_003E1__state = -1);1959					goto IL_046c;1960				case 2:1961					val2 = _003C_003Eu__2;1962					_003C_003Eu__2 = default(ConfiguredTaskAwaiter<IEntity>);1963					num = (_003C_003E1__state = -1);1964					goto IL_096b;1965				case 3:1966					val = _003C_003Eu__3;1967					_003C_003Eu__3 = default(ConfiguredTaskAwaiter);1968					num = (_003C_003E1__state = -1);1969					goto IL_09e9;1970				case 4:1971					val2 = _003C_003Eu__2;1972					_003C_003Eu__2 = default(ConfiguredTaskAwaiter<IEntity>);1973					num = (_003C_003E1__state = -1);1974					goto IL_0a8b;1975				case 5:1976					{1977						val = _003C_003Eu__3;1978						_003C_003Eu__3 = default(ConfiguredTaskAwaiter);1979						num = (_003C_003E1__state = -1);1980						break;1981					}1982					IL_096b:1983					result = val2.GetResult();1984					val4 = dialogJobGenAssemblyBuilder._GenerateJobAsync(code, result, identityMap, ct).ConfigureAwait(false);1985					val = ((ConfiguredTaskAwaitable)(ref val4)).GetAwaiter();1986					if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)1987					{1988						num = (_003C_003E1__state = 3);1989						_003C_003Eu__3 = val;1990						((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003C_GenerateJobAsync_003Ed__23>(ref val, ref this);1991						return;1992					}1993					goto IL_09e9;1994					IL_0a8b:1995					result2 = val2.GetResult();1996					val4 = dialogJobGenAssemblyBuilder._GenerateJobAsync(code, result2, identityMap, ct).ConfigureAwait(false);1997					val = ((ConfiguredTaskAwaitable)(ref val4)).GetAwaiter();1998					if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)1999					{2000						num = (_003C_003E1__state = 5);2001						_003C_003Eu__3 = val;2002						((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003C_GenerateJobAsync_003Ed__23>(ref val, ref this);2003						return;2004					}2005					break;2006					IL_09e9:2007					((ConfiguredTaskAwaiter)(ref val)).GetResult();2008					goto IL_09f0;2009					IL_09f0:2010					if (!string.IsNullOrEmpty(_003CuidError_003E5__7))2011					{2012						DbObjectKey key = new DbObjectKey("Job", _003CuidError_003E5__7);2013						val2 = _GetReferencedObj(_003Csession_003E5__2.Resolve<IEntitySource>(), dialogJobGenAssemblyBuilder._jobObjs, key, ct).ConfigureAwait(false).GetAwaiter();2014						if (!val2.IsCompleted)2015						{2016							num = (_003C_003E1__state = 4);2017							_003C_003Eu__2 = val2;2018							((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntity>, _003C_GenerateJobAsync_003Ed__23>(ref val2, ref this);2019							return;2020						}2021						goto IL_0a8b;2022					}2023					goto end_IL_000e;2024					IL_0112:2025					result3 = val3.GetResult();2026					provider = theJob.CreateWalker(_003Csession_003E5__2, identityMap);2027					_003Crep_003E5__3 = new _ValueReplacer(result3, provider);2028					_003ChasCondition_003E5__4 = _TrimAll(theJob.GetValue<string>("GenCondition")).Length > 0;2029					_003ChasPreproc_003E5__5 = _TrimAll(theJob.GetValue<string>("PreProcessorCondition")).Length > 0;2030					_003CuidSuccessor_003E5__6 = theJob.GetValue<string>("UID_SuccessJob");2031					_003CuidError_003E5__7 = theJob.GetValue<string>("UID_ErrorJob");2032					code.Append(_003Crep_003E5__3.Replace("Job_Start"));2033					if (_003ChasPreproc_003E5__5)2034					{2035						code.Append(_003Crep_003E5__3.Replace("Job_Preproc"));2036					}2037					code.Append(_003Crep_003E5__3.Replace("Job_Header"));2038					if (_TrimAll(theJob.GetValue("PreCode").String).Length > 0)2039					{2040						code.Append(_003Crep_003E5__3.Replace("Job_PreCode"));2041					}2042					if (_003ChasCondition_003E5__4)2043					{2044						code.Append(_003Crep_003E5__3.Replace("Job_GenCondition_Start"));2045					}2046					code.Append(_003Crep_003E5__3.Replace("Job_Body"));2047					code.Append(string.IsNullOrWhiteSpace(theJob.GetValue<string>("PriorityDefinition")) ? _003Crep_003E5__3.Replace("Job_Priority") : _003Crep_003E5__3.Replace("Job_PriorityDefinition"));2048					if (_TrimAll(theJob.GetValue("ServerDetectScript").String).Length > 0)2049					{2050						if (_regValueIs.IsMatch(theJob.GetValue("ServerDetectScript").String))2051						{2052							code.Append(_003Crep_003E5__3.Replace("Job_ServerDetectScript"));2053						}2054						else2055						{2056							code.Append(_003Crep_003E5__3.Replace("Job_ServerDetectScript_Old"));2057						}2058					}2059					else2060					{2061						if (string.IsNullOrEmpty(theJob.GetValue<string>("UID_QBMServerTag")))2062						{2063							throw new ViException(57335006, theJob.Display);2064						}2065						code.Append(_003Crep_003E5__3.Replace("Job_ServerMask"));2066					}2067					code.Append(_003Crep_003E5__3.Replace("Job_AssignQueue"));2068					code.Append(_003Crep_003E5__3.Replace("Job_AffectedBy"));2069					_003C_003E8__1.uidJob = theJob.GetValue<string>("UID_Job");2070					val3 = _003Csession_003E5__2.MetaData().GetTableAsync("JobRunParameter", ct).ConfigureAwait(false)2071						.GetAwaiter();2072					if (!val3.IsCompleted)2073					{2074						num = (_003C_003E1__state = 1);2075						_003C_003Eu__1 = val3;2076						((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IMetaTable>, _003C_GenerateJobAsync_003Ed__23>(ref val3, ref this);2077						return;2078					}2079					goto IL_046c;2080					IL_046c:2081					result4 = val3.GetResult();2082					enumerator = Enumerable.Where<IEntity>((System.Collections.Generic.IEnumerable<IEntity>)dialogJobGenAssemblyBuilder._runParamObjs.Values, (Func<IEntity, bool>)((IEntity p) => p.GetValue<string>("UID_Job") == _003C_003E8__1.uidJob)).GetEnumerator();2083					try2084					{2085						while (((System.Collections.IEnumerator)enumerator).MoveNext())2086						{2087							IEntity current = enumerator.Current;2088							IEntityWalker provider2 = current.CreateWalker(_003Csession_003E5__2, identityMap);2089							bool value = provider2.GetValue<bool>("FK(UID_JobParameter).IsOptional");2090							bool flag = provider2.GetValue<bool>("FK(UID_JobParameter).IsCrypted") || current.GetValue<bool>("IsCrypted");2091							bool flag2 = provider2.GetValue<bool>("FK(UID_JobParameter).IsPartialCrypted") || current.GetValue<bool>("IsPartialCrypted");2092							bool flag3 = flag || flag2 || provider2.GetValue<bool>("FK(UID_JobParameter).IsHidden") || current.GetValue<bool>("IsHidden");2093							if (_TrimAll(current.GetValue("ValueTemplate").String).Length > 0)2094							{2095								_ValueReplacer valueReplacer = new _ValueReplacer(result4, provider2);2096								code.Append(valueReplacer.Replace("JobParameter"));2097								code.Append(valueReplacer.Replace("JobParameter_VIValue"));2098								code.Append(valueReplacer.Replace("JobParameter_Catch"));2099								code.Append(value ? valueReplacer.Replace("JobParameter_EmptyCheck") : valueReplacer.Replace("JobParameter_NotEmptyCheck"));2100								code.Append(valueReplacer.Replace("JobParameter_Value"));2101								if (flag || flag2)2102								{2103									code.Append(valueReplacer.Replace("JobParameter_Value_IsCrypted"));2104								}2105								if (flag3)2106								{2107									code.Append(valueReplacer.Replace("JobParameter_Value_IsHidden"));2108								}2109								if (flag)2110								{2111									code.Append(valueReplacer.Replace("JobParameter_Value_Encrypt"));2112								}2113								code.Append(valueReplacer.Replace("JobParameter_Value_Add"));2114								code.Append(valueReplacer.Replace(flag3 ? "JobParameter_Value_LogHidden" : "JobParameter_Value_LogNormal"));2115								if (value)2116								{2117									code.Append(valueReplacer.Replace("JobParameter_WasEmpty"));2118								}2119							}2120						}2121					}2122					finally2123					{2124						if (num < 0)2125						{2126							((System.IDisposable)enumerator)?.Dispose();2127						}2128					}2129					code.Append(Environment.NewLine);2130					if (theJob.GetValue("ProcessTracking").Int > 0)2131					{2132						code.Append(_003Crep_003E5__3.Replace("Job_ProcessTracking"));2133					}2134					if (theJob.GetValue("SuccessNotify").Bool)2135					{2136						code.Append(_003Crep_003E5__3.Replace("Job_SuccessNotify"));2137					}2138					if (theJob.GetValue("ErrorNotify").Bool)2139					{2140						code.Append(_003Crep_003E5__3.Replace("Job_ErrorNotify"));2141					}2142					if (!string.IsNullOrEmpty(_003CuidSuccessor_003E5__6))2143					{2144						code.Append(_003Crep_003E5__3.Replace("Job_Successor"));2145					}2146					if (!string.IsNullOrEmpty(_003CuidError_003E5__7))2147					{2148						code.Append(_003Crep_003E5__3.Replace("Job_ErrorSuccessor"));2149					}2150					code.Append(_003Crep_003E5__3.Replace("Job_Body_End"));2151					if (_003ChasCondition_003E5__4)2152					{2153						if (!string.IsNullOrEmpty(_003CuidSuccessor_003E5__6))2154						{2155							code.Append(_003Crep_003E5__3.Replace("Job_GenCondition_Successor"));2156						}2157						code.Append(_003Crep_003E5__3.Replace("Job_GenCondition_End"));2158					}2159					code.Append(_003Crep_003E5__3.Replace("Job_Footer"));2160					if (_003ChasPreproc_003E5__5)2161					{2162						code.Append(string.IsNullOrEmpty(_003CuidSuccessor_003E5__6) ? _003Crep_003E5__3.Replace("Job_PreprocEndWithoutSuccessor") : _003Crep_003E5__3.Replace("Job_PreprocEndWithSuccessor"));2163					}2164					code.Append(_003Crep_003E5__3.Replace("Job_End"));2165					dialogJobGenAssemblyBuilder._jobs.Add(theJob.GetValue<string>("UID_Job"));2166					if (!string.IsNullOrEmpty(_003CuidSuccessor_003E5__6))2167					{2168						DbObjectKey key2 = new DbObjectKey("Job", _003CuidSuccessor_003E5__6);2169						val2 = _GetReferencedObj(_003Csession_003E5__2.Resolve<IEntitySource>(), dialogJobGenAssemblyBuilder._jobObjs, key2, ct).ConfigureAwait(false).GetAwaiter();2170						if (!val2.IsCompleted)2171						{2172							num = (_003C_003E1__state = 2);2173							_003C_003Eu__2 = val2;2174							((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntity>, _003C_GenerateJobAsync_003Ed__23>(ref val2, ref this);2175							return;2176						}2177						goto IL_096b;2178					}2179					goto IL_09f0;2180				}2181				((ConfiguredTaskAwaiter)(ref val)).GetResult();2182				end_IL_000e:;2183			}2184			catch (System.Exception exception)2185			{2186				_003C_003E1__state = -2;2187				_003C_003E8__1 = null;2188				_003Csession_003E5__2 = null;2189				_003Crep_003E5__3 = null;2190				_003CuidSuccessor_003E5__6 = null;2191				_003CuidError_003E5__7 = null;2192				((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);2193				return;2194			}2195			_003C_003E1__state = -2;2196			_003C_003E8__1 = null;2197			_003Csession_003E5__2 = null;2198			_003Crep_003E5__3 = null;2199			_003CuidSuccessor_003E5__6 = null;2200			_003CuidError_003E5__7 = null;2201			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();2202		}22032204		[DebuggerHidden]2205		private void SetStateMachine(IAsyncStateMachine stateMachine)2206		{2207			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);2208		}2209	}22102211	[StructLayout((LayoutKind)3)]2212	[CompilerGenerated]2213	private struct _003C_GetReferencedObj_003Ed__27 : IAsyncStateMachine2214	{2215		public int _003C_003E1__state;22162217		public AsyncTaskMethodBuilder<IEntity> _003C_003Et__builder;22182219		public IMetaTableRelation fk;22202221		public IEntity baseEntity;22222223		public CancellationToken ct;22242225		public IEntitySource src;22262227		public Dictionary<DbObjectKey, IEntity> optCollection;22282229		private ConfiguredTaskAwaiter<DbObjectKey> _003C_003Eu__1;22302231		private ConfiguredTaskAwaiter<IEntity> _003C_003Eu__2;22322233		private void MoveNext()2234		{2235			//IL_0065: Unknown result type (might be due to invalid IL or missing references)2236			//IL_006a: Unknown result type (might be due to invalid IL or missing references)2237			//IL_0071: Unknown result type (might be due to invalid IL or missing references)2238			//IL_0096: Unknown result type (might be due to invalid IL or missing references)2239			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)2240			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)2241			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)2242			//IL_00af: Unknown result type (might be due to invalid IL or missing references)2243			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)2244			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)2245			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)2246			//IL_001e: Unknown result type (might be due to invalid IL or missing references)2247			//IL_0029: Unknown result type (might be due to invalid IL or missing references)2248			//IL_002e: Unknown result type (might be due to invalid IL or missing references)2249			//IL_0032: Unknown result type (might be due to invalid IL or missing references)2250			//IL_0037: Unknown result type (might be due to invalid IL or missing references)2251			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)2252			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)2253			//IL_004b: Unknown result type (might be due to invalid IL or missing references)2254			//IL_004c: Unknown result type (might be due to invalid IL or missing references)2255			int num = _003C_003E1__state;2256			IEntity result2;2257			try2258			{2259				ConfiguredTaskAwaiter<IEntity> val;2260				ConfiguredTaskAwaiter<DbObjectKey> val2;2261				if (num != 0)2262				{2263					if (num == 1)2264					{2265						val = _003C_003Eu__2;2266						_003C_003Eu__2 = default(ConfiguredTaskAwaiter<IEntity>);2267						num = (_003C_003E1__state = -1);2268						goto IL_00f8;2269					}2270					val2 = DbObjectKey.CreateAsync(fk, baseEntity, ct).ConfigureAwait(false).GetAwaiter();2271					if (!val2.IsCompleted)2272					{2273						num = (_003C_003E1__state = 0);2274						_003C_003Eu__1 = val2;2275						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<DbObjectKey>, _003C_GetReferencedObj_003Ed__27>(ref val2, ref this);2276						return;2277					}2278				}2279				else2280				{2281					val2 = _003C_003Eu__1;2282					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<DbObjectKey>);2283					num = (_003C_003E1__state = -1);2284				}2285				DbObjectKey result = val2.GetResult();2286				val = _GetReferencedObj(src, optCollection, result, ct).ConfigureAwait(false).GetAwaiter();2287				if (!val.IsCompleted)2288				{2289					num = (_003C_003E1__state = 1);2290					_003C_003Eu__2 = val;2291					_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntity>, _003C_GetReferencedObj_003Ed__27>(ref val, ref this);2292					return;2293				}2294				goto IL_00f8;2295				IL_00f8:2296				result2 = val.GetResult();2297			}2298			catch (System.Exception exception)2299			{2300				_003C_003E1__state = -2;2301				_003C_003Et__builder.SetException(exception);2302				return;2303			}2304			_003C_003E1__state = -2;2305			_003C_003Et__builder.SetResult(result2);2306		}23072308		[DebuggerHidden]2309		private void SetStateMachine(IAsyncStateMachine stateMachine)2310		{2311			_003C_003Et__builder.SetStateMachine(stateMachine);2312		}2313	}23142315	private static readonly IScriptLanguage _scriptLanguage;23162317	private HashSet<string> _chains;23182319	private HashSet<string> _jobs;23202321	private Dictionary<DbObjectKey, IEntity> _chainObjs;23222323	private Dictionary<DbObjectKey, IEntity> _jobObjs;23242325	private Dictionary<DbObjectKey, IEntity> _runParamObjs;23262327	private readonly BinaryExpressionParser _preprocParser;23282329	private static readonly Regex _regValueIs;23302331	[field: CompilerGenerated]2332	public string[] UidsOfChainsToInclude2333	{2334		[CompilerGenerated]2335		get;2336		[CompilerGenerated]2337		set;2338	}23392340	[field: CompilerGenerated]2341	private static CodeDictionary _Code2342	{2343		[CompilerGenerated]2344		get;2345	}23462347	static DialogJobGenAssemblyBuilder()2348	{2349		//IL_000a: Unknown result type (might be due to invalid IL or missing references)2350		//IL_0014: Expected O, but got Unknown2351		//IL_0046: Unknown result type (might be due to invalid IL or missing references)2352		//IL_004c: Expected O, but got Unknown2353		//IL_0040: Unknown result type (might be due to invalid IL or missing references)2354		_regValueIs = new Regex("Value\\s*=", (RegexOptions)513);2355		_Code = new CodeDictionary();2356		StreamReader val = new StreamReader(typeof(DialogJobGenAssemblyBuilder).Assembly.GetManifestResourceStream("VI.DB.Compile.Resources.JobGenTemplates.txt") ?? throw new FileNotFoundException("Internal error: Resource file JobGenTemplates.txt was not found."));2357		try2358		{2359			_Code.Read((TextReader)(object)val);2360		}2361		finally2362		{2363			((System.IDisposable)val)?.Dispose();2364		}2365		_scriptLanguage = new VbScriptLanguage();2366	}23672368	private protected DialogJobGenAssemblyBuilder(ISession session, IMetaTable table, string[] preprocDefines, ScriptCompilerOptions options)2369		: base(session, table, options)2370	{2371		//IL_0012: Unknown result type (might be due to invalid IL or missing references)2372		if (preprocDefines == null)2373		{2374			throw new ArgumentNullException("preprocDefines");2375		}2376		_preprocParser = new BinaryExpressionParser(System.ReadOnlySpan<string>.op_Implicit(preprocDefines));2377	}23782379	[AsyncStateMachine(typeof(_003CCreateAsync_003Ed__11))]2380	public static async System.Threading.Tasks.Task<DialogJobGenAssemblyBuilder> CreateAsync(ISession session, IMetaTable table, string[] preprocDefines = null, ScriptCompilerOptions options = null, CancellationToken ct = default(CancellationToken))2381	{2382		//IL_0002: Unknown result type (might be due to invalid IL or missing references)2383		//IL_0007: Unknown result type (might be due to invalid IL or missing references)2384		//IL_002e: Unknown result type (might be due to invalid IL or missing references)2385		//IL_0030: Unknown result type (might be due to invalid IL or missing references)2386		if (preprocDefines == null)2387		{2388			preprocDefines = await session.Config().GetPreprocessorDefinesAsync(ct).ConfigureAwait(false);2389		}2390		return new DialogJobGenAssemblyBuilder(session, table, preprocDefines, options);2391	}23922393	[AsyncStateMachine(typeof(_003CCreateAsync_003Ed__12))]2394	public static async System.Threading.Tasks.Task<DialogJobGenAssemblyBuilder> CreateAsync(ISession session, string tablename, string[] preprocDefines = null, ScriptCompilerOptions options = null, CancellationToken ct = default(CancellationToken))2395	{2396		//IL_0002: Unknown result type (might be due to invalid IL or missing references)2397		//IL_0007: Unknown result type (might be due to invalid IL or missing references)2398		//IL_002e: Unknown result type (might be due to invalid IL or missing references)2399		//IL_0030: Unknown result type (might be due to invalid IL or missing references)2400		IMetaTable table = await session.MetaData().GetTableAsync(tablename, ct).ConfigureAwait(false);2401		if (preprocDefines == null)2402		{2403			preprocDefines = await session.Config().GetPreprocessorDefinesAsync(ct).ConfigureAwait(false);2404		}2405		return new DialogJobGenAssemblyBuilder(session, table, preprocDefines, options);2406	}24072408	[AsyncStateMachine(typeof(_003CGenerateSourceAsync_003Ed__17))]2409	public override async System.Threading.Tasks.Task<string> GenerateSourceAsync(CancellationToken ct = default(CancellationToken))2410	{2411		//IL_0002: Unknown result type (might be due to invalid IL or missing references)2412		//IL_0007: Unknown result type (might be due to invalid IL or missing references)2413		//IL_0016: Unknown result type (might be due to invalid IL or missing references)2414		//IL_0017: Unknown result type (might be due to invalid IL or missing references)2415		if (base.Table.IsDeactivated)2416		{2417			throw new ViException(810135, ExceptionRelevance.Technical, base.Tablename);2418		}2419		StringBuilder code = new StringBuilder();2420		ISqlFormatter f = base.Session.Resolve<ISqlFormatter>();2421		IdentityMap identityMap = new IdentityMap(base.Session.Source());2422		_chainObjs = await _BufferAndReturnObjectsAsync(Query.From("JobChain").Where(_BuildWhereClause(f, "UID_DialogTable", "NoGenerate", "UID_JobChain")).SelectNonLobs(), identityMap, ct).ConfigureAwait(false);2423		_jobObjs = await _BufferAndReturnObjectsAsync(Query.From("Job").Where(string.Format("uid_jobchain in (select uid_jobchain from jobchain where {0})", (object)_BuildWhereClause(f, "UID_DialogTable", "NoGenerate", "UID_JobChain"))).SelectNonLobs(), identityMap, ct).ConfigureAwait(false);2424		_runParamObjs = await _BufferAndReturnObjectsAsync(Query.From("JobRunParameter").Where(string.Format("uid_job in (select j.uid_job from job j join jobchain c on c.uid_jobchain = j.uid_jobchain where {0})", (object)_BuildWhereClause(f, "c.UID_DialogTable", "c.NoGenerate", "c.UID_JobChain"))).SelectNonLobs(), identityMap, ct).ConfigureAwait(false);2425		await _BufferObjectsAsync(Query.From("JobComponent").Where(string.Format("uid_jobcomponent in (select t.uid_jobcomponent from jobtask t join job j on j.uid_jobtask = t.uid_jobtask join jobchain c on c.uid_jobchain = j.uid_jobchain where {0})", (object)_BuildWhereClause(f, "c.UID_DialogTable", "c.NoGenerate", "c.UID_JobChain"))).SelectNonLobs(), identityMap, ct).ConfigureAwait(false);2426		await _BufferObjectsAsync(Query.From("JobTask").Where(string.Format("uid_jobtask in (select j.uid_jobtask from job j join jobchain c on c.uid_jobchain = j.uid_jobchain where {0})", (object)_BuildWhereClause(f, "c.UID_DialogTable", "c.NoGenerate", "c.UID_JobChain"))).SelectNonLobs(), identityMap, ct).ConfigureAwait(false);2427		await _BufferObjectsAsync(Query.From("JobParameter").Where(string.Format("uid_jobtask in (select j.uid_jobtask from job j join jobchain c on c.uid_jobchain = j.uid_jobchain where {0})", (object)_BuildWhereClause(f, "c.UID_DialogTable", "c.NoGenerate", "c.UID_JobChain"))).SelectNonLobs(), identityMap, ct).ConfigureAwait(false);2428		_chains = new HashSet<string>();2429		_jobs = new HashSet<string>();2430		code.Append(((Dictionary<string, string>)_Code)["Header"]);2431		return (await _GenerateEventsAsync(code, identityMap, ct).ConfigureAwait(false)) ? ((object)code).ToString() : string.Empty;2432	}24332434	private string _BuildWhereClause(ISqlFormatter f, string uidDialogTableColumn, string noGenerateColumn, string uidJobChainColumn)2435	{2436		string[] obj = new string[3]2437		{2438			f.Comparison(uidDialogTableColumn, base.Table.Uid, ValType.String, CompareOperator.Equal, FormatterOptions.NonUnicodeLiterals),2439			f.Comparison(noGenerateColumn, false, ValType.Bool),2440			null2441		};2442		object obj2;2443		if (UidsOfChainsToInclude == null || UidsOfChainsToInclude.Length == 0)2444		{2445			obj2 = null;2446		}2447		else2448		{2449			object[] uidsOfChainsToInclude = UidsOfChainsToInclude;2450			obj2 = f.InClause(uidJobChainColumn, ValType.String, FormatterOptions.NonUnicodeLiterals, uidsOfChainsToInclude);2451		}2452		obj[2] = (string)obj2;2453		return f.AndRelation(obj);2454	}24552456	[AsyncStateMachine(typeof(_003C_BufferAndReturnObjectsAsync_003Ed__19))]2457	private async System.Threading.Tasks.Task<Dictionary<DbObjectKey, IEntity>> _BufferAndReturnObjectsAsync(Query query, IdentityMap identityMap, CancellationToken cancellationToken)2458	{2459		//IL_0002: Unknown result type (might be due to invalid IL or missing references)2460		//IL_0007: Unknown result type (might be due to invalid IL or missing references)2461		//IL_0026: Unknown result type (might be due to invalid IL or missing references)2462		//IL_0027: Unknown result type (might be due to invalid IL or missing references)2463		IMetaData metaData = base.Session.Resolve<IMetaData>();2464		IEntitySource src = base.Session.Resolve<IEntitySource>();2465		IMetaTable table = await metaData.GetTableAsync(query.Table.Tablename, cancellationToken).ConfigureAwait(false);2466		IEntityCollection entityCollection = await src.GetCollectionAsync(query, EntityCollectionLoadType.BulkReadOnly | EntityCollectionLoadType.Slim, cancellationToken).ConfigureAwait(false);2467		Dictionary<DbObjectKey, IEntity> ret = new Dictionary<DbObjectKey, IEntity>();2468		System.Collections.Generic.IEnumerator<IEntity> enumerator = ((System.Collections.Generic.IEnumerable<IEntity>)entityCollection).GetEnumerator();2469		try2470		{2471			while (((System.Collections.IEnumerator)enumerator).MoveNext())2472			{2473				IEntity entity = enumerator.Current;2474				DbObjectKey dbObjectKey = await DbObjectKey.CreateAsync(table, entity, cancellationToken).ConfigureAwait(false);2475				identityMap.RegisterEternal(dbObjectKey, entity);2476				ret[dbObjectKey] = entity;2477			}2478		}2479		finally2480		{2481			((System.IDisposable)enumerator)?.Dispose();2482		}2483		return ret;2484	}24852486	[AsyncStateMachine(typeof(_003C_BufferObjectsAsync_003Ed__20))]2487	private System.Threading.Tasks.Task _BufferObjectsAsync(Query query, IdentityMap identityMap, CancellationToken cancellationToken)2488	{2489		//IL_0002: Unknown result type (might be due to invalid IL or missing references)2490		//IL_0007: Unknown result type (might be due to invalid IL or missing references)2491		//IL_0026: Unknown result type (might be due to invalid IL or missing references)2492		//IL_0027: Unknown result type (might be due to invalid IL or missing references)2493		_003C_BufferObjectsAsync_003Ed__20 _003C_BufferObjectsAsync_003Ed__ = default(_003C_BufferObjectsAsync_003Ed__20);2494		_003C_BufferObjectsAsync_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();2495		_003C_BufferObjectsAsync_003Ed__._003C_003E4__this = this;2496		_003C_BufferObjectsAsync_003Ed__.query = query;2497		_003C_BufferObjectsAsync_003Ed__.identityMap = identityMap;2498		_003C_BufferObjectsAsync_003Ed__.cancellationToken = cancellationToken;2499		_003C_BufferObjectsAsync_003Ed__._003C_003E1__state = -1;2500		((AsyncTaskMethodBuilder)(ref _003C_BufferObjectsAsync_003Ed__._003C_003Et__builder)).Start<_003C_BufferObjectsAsync_003Ed__20>(ref _003C_BufferObjectsAsync_003Ed__);2501		return ((AsyncTaskMethodBuilder)(ref _003C_BufferObjectsAsync_003Ed__._003C_003Et__builder)).Task;2502	}25032504	[AsyncStateMachine(typeof(_003C_GenerateEventsAsync_003Ed__21))]2505	private async System.Threading.Tasks.Task<bool> _GenerateEventsAsync(StringBuilder code, IdentityMap identityMap, CancellationToken ct)2506	{2507		//IL_0002: Unknown result type (might be due to invalid IL or missing references)2508		//IL_0007: Unknown result type (might be due to invalid IL or missing references)2509		//IL_0026: Unknown result type (might be due to invalid IL or missing references)2510		//IL_0027: Unknown result type (might be due to invalid IL or missing references)2511		string footer = null;2512		string eventName = "";2513		SortedList<string, IEntity> chains = new SortedList<string, IEntity>();2514		ISqlFormatter f = base.Session.SqlFormatter();2515		ISession session = base.Session;2516		IMetaTable jobEventGenTable = await session.MetaData().GetTableAsync("JobEventGen", ct).ConfigureAwait(false);2517		IMetaTable qbmEventTable = await session.MetaData().GetTableAsync("QBMEvent", ct).ConfigureAwait(false);2518		ISelect obj = Query.From("JobEventGen").Where(string.Format("exists (select 1 from QBMEvent e where e.UID_QBMEvent = JobEventGen.UID_QBMEvent and {0})", (object)f.UidComparison("e.UID_DialogTable", base.Table.Uid)));2519		string[] obj2 = new string[2]2520		{2521			f.Comparison("JobChain.NoGenerate", false, ValType.Bool),2522			null2523		};2524		object obj3;2525		if (UidsOfChainsToInclude == null || UidsOfChainsToInclude.Length == 0)2526		{2527			obj3 = null;2528		}2529		else2530		{2531			object[] uidsOfChainsToInclude = UidsOfChainsToInclude;2532			obj3 = f.InClause("jobchain.uid_jobchain", ValType.String, FormatterOptions.NonUnicodeLiterals, uidsOfChainsToInclude);2533		}2534		obj2[1] = (string)obj3;2535		Query query = obj.Where($"exists ( select name from jobchain where jobchain.uid_jobchain = jobeventgen.uid_jobchain and {f.AndRelation(obj2)})").SelectNonLobs();2536		IEntityCollection jobEventGens = await session.Resolve<IEntitySource>().GetCollectionAsync(query, EntityCollectionLoadType.BulkReadOnly | EntityCollectionLoadType.Slim, ct).ConfigureAwait(false);2537		Query query2 = (from t in Query.From("QBMEvent")2538			where t.Column("UID_QBMEvent").In(Enumerable.Select<IEntity, string>((System.Collections.Generic.IEnumerable<IEntity>)jobEventGens, (Func<IEntity, string>)((IEntity e) => e.GetValue<string>("UID_QBMEvent"))))2539			select t).SelectNonLobs();2540		Dictionary<string, IEntity> qbmEvents = Enumerable.ToDictionary<IEntity, string>((System.Collections.Generic.IEnumerable<IEntity>)(await session.Resolve<IEntitySource>().GetCollectionAsync(query2, EntityCollectionLoadType.BulkReadOnly | EntityCollectionLoadType.Slim, ct).ConfigureAwait(false)), (Func<IEntity, string>)((IEntity e) => e.GetValue<string>("UID_QBMEvent")), (IEqualityComparer<string>)(object)StringComparer.Ordinal);2541		var val = Enumerable.ThenBy(Enumerable.OrderBy(Enumerable.Where(Enumerable.Select((System.Collections.Generic.IEnumerable<IEntity>)jobEventGens, delegate(IEntity e)2542		{2543			IEntity qBMEvent = default(IEntity);2544			qbmEvents.TryGetValue(e.GetValue<string>("UID_QBMEvent"), ref qBMEvent);2545			return new2546			{2547				JobEventGen = e,2548				QBMEvent = qBMEvent2549			};2550		}), e => e.QBMEvent != null), e => e.QBMEvent.GetValue<string>("EventName"), (IComparer<string>)(object)StringComparer.OrdinalIgnoreCase), e => e.JobEventGen.GetValue<int>("OrderNr"));2551		var enumerator = ((System.Collections.Generic.IEnumerable<global::_003C_003Ef__AnonymousType0<IEntity, IEntity>>)val).GetEnumerator();2552		try2553		{2554			while (((System.Collections.IEnumerator)enumerator).MoveNext())2555			{2556				var evt = enumerator.Current;2557				DbObjectKey keyJobGenEvent = await DbObjectKey.CreateAsync(jobEventGenTable, evt.JobEventGen, ct).ConfigureAwait(false);2558				DbObjectKey key = await DbObjectKey.CreateAsync(qbmEventTable, evt.QBMEvent, ct).ConfigureAwait(false);2559				identityMap.RegisterEternal(keyJobGenEvent, evt.JobEventGen);2560				identityMap.RegisterEternal(key, evt.QBMEvent);2561				IEntityWalker walker = evt.JobEventGen.CreateWalker(session, identityMap);2562				_ValueReplacer rep = new _ValueReplacer(jobEventGenTable, walker);2563				string value = evt.QBMEvent.GetValue<string>("EventName");2564				if (!string.Equals(value, eventName, (StringComparison)5))2565				{2566					if (footer != null)2567					{2568						code.Append(footer);2569					}2570					eventName = value;2571					code.Append(rep.Replace("Event_Header"));2572					footer = rep.Replace("Event_Footer");2573				}2574				bool enabled;2575				try2576				{2577					enabled = _ParseExpression(await walker.GetValueAsync<string>("FK(UID_JobChain).PreprocessorCondition", ct).ConfigureAwait(false));2578				}2579				catch (System.Exception ex)2580				{2581					ScriptError scriptError = new ScriptError2582					{2583						Column = 02584					};2585					LanguageManager instance = LanguageManager.Instance;2586					object value2 = walker.GetValue<string>("FK(UID_JobChain).Name");2587					scriptError.ErrorText = instance.FormatString("strError810147", new System.ReadOnlySpan<object>(ref value2)) + " " + ex.Message;2588					scriptError.FileName = "Unknown File";2589					scriptError.Line = 1;2590					ScriptError scriptError2 = scriptError;2591					scriptError2.ObjectKey = await DbObjectKey.CreateAsync(jobEventGenTable.Columns["UID_JobChain"].GetFKRelation(), evt.JobEventGen, ct).ConfigureAwait(false);2592					scriptError.ScriptLine = 1;2593					scriptError.ScriptName = "PreprocessorCondition of job " + walker.GetValue<string>("FK(UID_JobChain).Name");2594					ScriptError scriptError3 = scriptError;2595					throw new ScriptCompileException(new ScriptError[1] { scriptError3 }, walker.GetValue<string>("FK(UID_JobChain).PreprocessorCondition"));2596				}2597				if (enabled)2598				{2599					code.Append(rep.Replace("Event_Chain"));2600					if (!string.IsNullOrEmpty(evt.JobEventGen.GetValue("ProcessDisplay").String))2601					{2602						code.Append(rep.Replace("Event_ProcessTracking"));2603					}2604					code.Append(rep.Replace("Event_EndChain"));2605					IEntitySource src = session.Resolve<IEntitySource>();2606					Dictionary<DbObjectKey, IEntity> chainObjs = _chainObjs;2607					IEntity entity = await _GetReferencedObj(src, chainObjs, await jobEventGenTable.Columns["UID_JobChain"].GetFKRelationAsync(ct).ConfigureAwait(false), evt.JobEventGen, ct).ConfigureAwait(false);2608					if (!chains.ContainsKey(entity.GetValue("Name").String))2609					{2610						chains.Add(entity.GetValue("Name").String, entity);2611					}2612				}2613			}2614		}2615		finally2616		{2617			((System.IDisposable)enumerator)?.Dispose();2618		}2619		if (footer != null)2620		{2621			code.Append(footer);2622		}2623		System.Collections.Generic.IEnumerator<IEntity> enumerator2 = ((System.Collections.Generic.IEnumerable<IEntity>)chains.Values).GetEnumerator();2624		try2625		{2626			while (((System.Collections.IEnumerator)enumerator2).MoveNext())2627			{2628				IEntity current = enumerator2.Current;2629				await _GenerateChainAsync(code, current, identityMap, ct).ConfigureAwait(false);2630			}2631		}2632		finally2633		{2634			((System.IDisposable)enumerator2)?.Dispose();2635		}2636		return chains.Count > 0;2637	}26382639	[AsyncStateMachine(typeof(_003C_GenerateChainAsync_003Ed__22))]2640	private System.Threading.Tasks.Task _GenerateChainAsync(StringBuilder code, IEntity theChain, IdentityMap identityMap, CancellationToken ct)2641	{2642		//IL_0002: Unknown result type (might be due to invalid IL or missing references)2643		//IL_0007: Unknown result type (might be due to invalid IL or missing references)2644		//IL_002e: Unknown result type (might be due to invalid IL or missing references)2645		//IL_0030: Unknown result type (might be due to invalid IL or missing references)2646		_003C_GenerateChainAsync_003Ed__22 _003C_GenerateChainAsync_003Ed__ = default(_003C_GenerateChainAsync_003Ed__22);2647		_003C_GenerateChainAsync_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();2648		_003C_GenerateChainAsync_003Ed__._003C_003E4__this = this;2649		_003C_GenerateChainAsync_003Ed__.code = code;2650		_003C_GenerateChainAsync_003Ed__.theChain = theChain;2651		_003C_GenerateChainAsync_003Ed__.identityMap = identityMap;2652		_003C_GenerateChainAsync_003Ed__.ct = ct;2653		_003C_GenerateChainAsync_003Ed__._003C_003E1__state = -1;2654		((AsyncTaskMethodBuilder)(ref _003C_GenerateChainAsync_003Ed__._003C_003Et__builder)).Start<_003C_GenerateChainAsync_003Ed__22>(ref _003C_GenerateChainAsync_003Ed__);2655		return ((AsyncTaskMethodBuilder)(ref _003C_GenerateChainAsync_003Ed__._003C_003Et__builder)).Task;2656	}26572658	[AsyncStateMachine(typeof(_003C_GenerateJobAsync_003Ed__23))]2659	private System.Threading.Tasks.Task _GenerateJobAsync(StringBuilder code, IEntity theJob, IdentityMap identityMap, CancellationToken ct)2660	{2661		//IL_0002: Unknown result type (might be due to invalid IL or missing references)2662		//IL_0007: Unknown result type (might be due to invalid IL or missing references)2663		//IL_002e: Unknown result type (might be due to invalid IL or missing references)2664		//IL_0030: Unknown result type (might be due to invalid IL or missing references)2665		_003C_GenerateJobAsync_003Ed__23 _003C_GenerateJobAsync_003Ed__ = default(_003C_GenerateJobAsync_003Ed__23);2666		_003C_GenerateJobAsync_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();2667		_003C_GenerateJobAsync_003Ed__._003C_003E4__this = this;2668		_003C_GenerateJobAsync_003Ed__.code = code;2669		_003C_GenerateJobAsync_003Ed__.theJob = theJob;2670		_003C_GenerateJobAsync_003Ed__.identityMap = identityMap;2671		_003C_GenerateJobAsync_003Ed__.ct = ct;2672		_003C_GenerateJobAsync_003Ed__._003C_003E1__state = -1;2673		((AsyncTaskMethodBuilder)(ref _003C_GenerateJobAsync_003Ed__._003C_003Et__builder)).Start<_003C_GenerateJobAsync_003Ed__23>(ref _003C_GenerateJobAsync_003Ed__);2674		return ((AsyncTaskMethodBuilder)(ref _003C_GenerateJobAsync_003Ed__._003C_003Et__builder)).Task;2675	}26762677	private bool _ParseExpression(string expression)2678	{2679		if (expression == null || expression.TrimEnd().Length == 0)2680		{2681			return true;2682		}2683		return _preprocParser.Parse(expression);2684	}26852686	private static string _TrimAll(string input)2687	{2688		if (string.IsNullOrEmpty(input))2689		{2690			return input;2691		}2692		string text = _scriptLanguage.RemoveComments(input);2693		char[] array = new char[4];2694		RuntimeHelpers.InitializeArray((System.Array)array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);2695		return text.Trim(array);2696	}26972698	private static System.Threading.Tasks.Task<IEntity> _GetReferencedObj(IEntitySource src, Dictionary<DbObjectKey, IEntity> optCollection, DbObjectKey key, CancellationToken ct)2699	{2700		//IL_0014: Unknown result type (might be due to invalid IL or missing references)2701		IEntity entity = default(IEntity);2702		if (optCollection.TryGetValue(key, ref entity))2703		{2704			return System.Threading.Tasks.Task.FromResult<IEntity>(entity);2705		}2706		return src.GetReadOnlyAsync(key, ct);2707	}27082709	[AsyncStateMachine(typeof(_003C_GetReferencedObj_003Ed__27))]2710	private static async System.Threading.Tasks.Task<IEntity> _GetReferencedObj(IEntitySource src, Dictionary<DbObjectKey, IEntity> optCollection, IMetaTableRelation fk, IEntity baseEntity, CancellationToken ct)2711	{2712		//IL_0002: Unknown result type (might be due to invalid IL or missing references)2713		//IL_0007: Unknown result type (might be due to invalid IL or missing references)2714		//IL_002e: Unknown result type (might be due to invalid IL or missing references)2715		//IL_0030: Unknown result type (might be due to invalid IL or missing references)2716		return await _GetReferencedObj(src, optCollection, await DbObjectKey.CreateAsync(fk, baseEntity, ct).ConfigureAwait(false), ct).ConfigureAwait(false);2717	}2718}2719