Back to OIM Explorer

Common.Customizer/VI.Common.Customizer/QBMModuleDef.cs

Decompiler Source FileCommon.Customizer.QBMModuleDefDecompiled Source

1 extracted method/event/call references in QBMModuleDef.

Source: F:\Claude\.tmp\oim-decompiled-full\0045_One_Identity_Manager_Common.Customizer.dll\VI.Common.Customizer\QBMModuleDef.cs

Source size: 40.077 characters

Interpretation

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

Relations

  • Method registration: UpdateModuleInfoXML at line 670

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 writes entity values references DB/Dialog objects

Summary: classes QBMModuleDef, _003C_003Ec__DisplayClass4_0, _003C_003Ec__DisplayClass4_1, _003C_003Ec__DisplayClass5_0; methods _003CGetModuleInfoXml_003Eb__3, _003CGetModuleInfoXml_003Eb__4, _003CGetModuleInfoXml_003Eb__6, _003CGetModuleInfoXml_003Eb__8, _003C_LoadModuleXmlAsync_003Eb__0, MoveNext; references QBMDeployTarget, QBMFileHasDeployTarget, QBMFileRevision, QBMModuleDef; markers reads entity values, writes entity values, references DB/Dialog objects

Classes

QBMModuleDef _003C_003Ec__DisplayClass4_0 _003C_003Ec__DisplayClass4_1 _003C_003Ec__DisplayClass5_0

OIM key/entity markers

UID_QBMFileRevision XObjectKey ObjectKeyDeployTarget UID_ModuleDef

API/entity calls

GetValue PutValue GetValueAsync From Source

Registrations / handlers

None extracted.

Complete Source

C#851 lines
1using System;2using System.Collections.Generic;3using System.Data;4using System.Data.Common;5using System.Diagnostics;6using System.Linq;7using System.Runtime.CompilerServices;8using System.Runtime.InteropServices;9using System.Threading;10using System.Threading.Tasks;11using InstallManager.Core.Data;12using InstallManager.Core.Data.Xml;13using InstallManager.Core.DataType;14using VI.Base;15using VI.DB;16using VI.DB.DataAccess;17using VI.DB.Entities;18using VI.DB.Sync;1920namespace VI.Common.Customizer;2122public class QBMModuleDef : StateBasedEntityLogic23{24	[CompilerGenerated]25	private sealed class _003C_003Ec__DisplayClass4_026	{27		public Dictionary<string, Guid> existingPackageIds;2829		public Dictionary<string, List<RelatedPackage>> assignedProducts;3031		internal Package _003CGetModuleInfoXml_003Eb__3(IEntity eFile)32		{33			//IL_0046: Unknown result type (might be due to invalid IL or missing references)34			//IL_003f: Unknown result type (might be due to invalid IL or missing references)35			string value = eFile.GetValue<string>("FileName");36			Package.File item = new Package.File(value, eFile.GetValue<bool>("IsToBackup"), eFile.GetValue<bool>("NeverUpdate"));37			Guid val = default(Guid);38			return new Package39			{40				Id = (existingPackageIds.TryGetValue(value, ref val) ? val : Guid.NewGuid()),41				Name = value,42				DisplayName = new LocalizedString(value, value),43				Description = new LocalizedString("", ""),44				Files = (System.Collections.Generic.IReadOnlyList<Package.File>)new List<Package.File>((System.Collections.Generic.IEnumerable<Package.File>)new global::_003C_003Ez__ReadOnlySingleElementList<Package.File>(item)),45				SubDirectory = eFile.GetValue("SourceDirectory")46			};47		}4849		internal DeploymentTarget _003CGetModuleInfoXml_003Eb__4(IEntity eDeployTarget)50		{51			string text = eDeployTarget.GetValue("FullPath");52			List<RelatedPackage> val = default(List<RelatedPackage>);53			return new DeploymentTarget54			{55				FullPath = text,56				DisplayName = new LocalizedString(eDeployTarget.Display, eDeployTarget.Display),57				RelatedPackages = (System.Collections.Generic.IEnumerable<RelatedPackage>)(assignedProducts.TryGetValue(text, ref val) ? val : new List<RelatedPackage>())58			};59		}60	}6162	[CompilerGenerated]63	private sealed class _003C_003Ec__DisplayClass4_164	{65		public _003C_003Ef__AnonymousType3<string, string, string> f;6667		public Func<Package.File, bool> _003C_003E9__8;6869		internal bool _003CGetModuleInfoXml_003Eb__6(Package p)70		{71			return Enumerable.Any<Package.File>((System.Collections.Generic.IEnumerable<Package.File>)p.Files, (Func<Package.File, bool>)((Package.File fi) => string.Equals(fi.Fullname, f.FileName, (StringComparison)5)));72		}7374		internal bool _003CGetModuleInfoXml_003Eb__8(Package.File fi)75		{76			return string.Equals(fi.Fullname, f.FileName, (StringComparison)5);77		}78	}7980	[CompilerGenerated]81	private sealed class _003C_003Ec__DisplayClass5_082	{83		public string name;8485		internal ExpressionClause _003C_LoadModuleXmlAsync_003Eb__0(IExpressionContext c)86		{87			return c.Column("ModuleName") == name;88		}89	}9091	[StructLayout((LayoutKind)3)]92	[CompilerGenerated]93	private struct _003CGetModuleInfoXml_003Ed__4 : IAsyncStateMachine94	{95		public int _003C_003E1__state;9697		public AsyncTaskMethodBuilder<string> _003C_003Et__builder;9899		public ISession session;100101		public CancellationToken ct;102103		public IEntity eModule;104105		private _003C_003Ec__DisplayClass4_0 _003C_003E8__1;106107		private _003C_003Ec__DisplayClass4_1 _003C_003E8__2;108109		private InstallModule _003CinstallModule_003E5__2;110111		private IEntityCollection _003CcolTargets_003E5__3;112113		private Dictionary<string, InstallModule> _003CcachedModules_003E5__4;114115		private ConfiguredTaskAwaiter<IEntityCollection> _003C_003Eu__1;116117		private ConfiguredTaskAwaiter<DbDataReader> _003C_003Eu__2;118119		private _003C_003Ef__AnonymousType3<string, string, string>[] _003C_003E7__wrap4;120121		private int _003C_003E7__wrap5;122123		private ConfiguredTaskAwaiter<InstallModule?> _003C_003Eu__3;124125		private void MoveNext()126		{127			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)128			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)129			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)130			//IL_028d: Unknown result type (might be due to invalid IL or missing references)131			//IL_0292: Unknown result type (might be due to invalid IL or missing references)132			//IL_029a: Unknown result type (might be due to invalid IL or missing references)133			//IL_034e: Unknown result type (might be due to invalid IL or missing references)134			//IL_0353: Unknown result type (might be due to invalid IL or missing references)135			//IL_035b: Unknown result type (might be due to invalid IL or missing references)136			//IL_043e: Unknown result type (might be due to invalid IL or missing references)137			//IL_0443: Unknown result type (might be due to invalid IL or missing references)138			//IL_044b: Unknown result type (might be due to invalid IL or missing references)139			//IL_0305: Unknown result type (might be due to invalid IL or missing references)140			//IL_0310: Unknown result type (might be due to invalid IL or missing references)141			//IL_0315: Unknown result type (might be due to invalid IL or missing references)142			//IL_0319: Unknown result type (might be due to invalid IL or missing references)143			//IL_031e: Unknown result type (might be due to invalid IL or missing references)144			//IL_0094: Unknown result type (might be due to invalid IL or missing references)145			//IL_009f: Unknown result type (might be due to invalid IL or missing references)146			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)147			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)148			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)149			//IL_0333: Unknown result type (might be due to invalid IL or missing references)150			//IL_0335: Unknown result type (might be due to invalid IL or missing references)151			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)152			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)153			//IL_018a: Unknown result type (might be due to invalid IL or missing references)154			//IL_0194: Expected O, but got Unknown155			//IL_03f5: Unknown result type (might be due to invalid IL or missing references)156			//IL_0400: Unknown result type (might be due to invalid IL or missing references)157			//IL_0405: Unknown result type (might be due to invalid IL or missing references)158			//IL_0409: Unknown result type (might be due to invalid IL or missing references)159			//IL_040e: Unknown result type (might be due to invalid IL or missing references)160			//IL_0244: Unknown result type (might be due to invalid IL or missing references)161			//IL_024f: Unknown result type (might be due to invalid IL or missing references)162			//IL_0254: Unknown result type (might be due to invalid IL or missing references)163			//IL_0258: Unknown result type (might be due to invalid IL or missing references)164			//IL_025d: Unknown result type (might be due to invalid IL or missing references)165			//IL_0423: Unknown result type (might be due to invalid IL or missing references)166			//IL_0425: Unknown result type (might be due to invalid IL or missing references)167			//IL_0272: Unknown result type (might be due to invalid IL or missing references)168			//IL_0274: Unknown result type (might be due to invalid IL or missing references)169			int num = _003C_003E1__state;170			string result2;171			try172			{173				ConfiguredTaskAwaiter<IEntityCollection> val3;174				ConfiguredTaskAwaiter<DbDataReader> val2;175				ConfiguredTaskAwaiter<InstallModule> val;176				_003C_003Ef__AnonymousType3<string, string, string>[] array;177				InstallModule result;178				IEntityCollection result3;179				Query query2;180				IEntityCollection result4;181				string sqlStatement;182				IDbSession dbSession;183				Dictionary<string, InstallModule> obj;184				switch (num)185				{186				default:187				{188					_003C_003E8__1 = new _003C_003Ec__DisplayClass4_0();189					Query query = (from t in Query.From("QBMFileRevision")190						where t.Column("UID_QBMFileRevision").StartsWith("CCC-")191						select t).Select("FileName", "IsToBackup", "NeverUpdate", "SourceDirectory");192					val3 = session.Source().GetCollectionAsync(query, EntityCollectionLoadType.Slim, ct).ConfigureAwait(false)193						.GetAwaiter();194					if (!val3.IsCompleted)195					{196						num = (_003C_003E1__state = 0);197						_003C_003Eu__1 = val3;198						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntityCollection>, _003CGetModuleInfoXml_003Ed__4>(ref val3, ref this);199						return;200					}201					goto IL_00f9;202				}203				case 0:204					val3 = _003C_003Eu__1;205					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<IEntityCollection>);206					num = (_003C_003E1__state = -1);207					goto IL_00f9;208				case 1:209					val3 = _003C_003Eu__1;210					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<IEntityCollection>);211					num = (_003C_003E1__state = -1);212					goto IL_02a9;213				case 2:214					val2 = _003C_003Eu__2;215					_003C_003Eu__2 = default(ConfiguredTaskAwaiter<DbDataReader>);216					num = (_003C_003E1__state = -1);217					goto IL_036a;218				case 3:219					{220						val = _003C_003Eu__3;221						_003C_003Eu__3 = default(ConfiguredTaskAwaiter<InstallModule>);222						num = (_003C_003E1__state = -1);223						goto IL_045a;224					}225					IL_036a:226					array = Enumerable.ToArray(Enumerable.Select(((IDataReader)(object)val2.GetResult()).FetchAll(), (IDataRecord r) => new227					{228						FullPath = r.GetString(0),229						ModuleId = Uid.GetModuleOwner(r.GetString(1)),230						FileName = r.GetString(2)231					}));232					_003C_003E7__wrap4 = array;233					_003C_003E7__wrap5 = 0;234					goto IL_050b;235					IL_045a:236					result = val.GetResult();237					if (result != null)238					{239						Package package = Enumerable.FirstOrDefault<Package>(result.Packages, (Func<Package, bool>)((Package p) => Enumerable.Any<Package.File>((System.Collections.Generic.IEnumerable<Package.File>)p.Files, (Func<Package.File, bool>)((Package.File fi) => string.Equals(fi.Fullname, _003C_003E8__2.f.FileName, (StringComparison)5)))));240						if (package != null)241						{242							RelatedPackage relatedPackage = new RelatedPackage(_003C_003E8__2.f.ModuleId, package.Name);243							((IDictionary<string, List<RelatedPackage>>)(object)_003C_003E8__1.assignedProducts).GetOrAdd<string, List<RelatedPackage>>(_003C_003E8__2.f.FullPath, (string _) => new List<RelatedPackage>()).Add(relatedPackage);244							_003C_003E8__2 = null;245						}246					}247					_003C_003E7__wrap5++;248					goto IL_050b;249					IL_050b:250					if (_003C_003E7__wrap5 < _003C_003E7__wrap4.Length)251					{252						_003C_003E8__2 = new _003C_003Ec__DisplayClass4_1();253						_003C_003E8__2.f = _003C_003E7__wrap4[_003C_003E7__wrap5];254						val = _LoadModuleXmlAsync(_003CcachedModules_003E5__4, session, _003C_003E8__2.f.ModuleId, ct).ConfigureAwait(false).GetAwaiter();255						if (!val.IsCompleted)256						{257							num = (_003C_003E1__state = 3);258							_003C_003Eu__3 = val;259							_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<InstallModule>, _003CGetModuleInfoXml_003Ed__4>(ref val, ref this);260							return;261						}262						goto IL_045a;263					}264					_003C_003E7__wrap4 = null;265					_003CinstallModule_003E5__2.DeploymentTargets = (System.Collections.Generic.IEnumerable<DeploymentTarget>)Enumerable.ToList<DeploymentTarget>(Enumerable.Select<IEntity, DeploymentTarget>((System.Collections.Generic.IEnumerable<IEntity>)_003CcolTargets_003E5__3, (Func<IEntity, DeploymentTarget>)delegate(IEntity eDeployTarget)266					{267						string text2 = eDeployTarget.GetValue("FullPath");268						List<RelatedPackage> val4 = default(List<RelatedPackage>);269						return new DeploymentTarget270						{271							FullPath = text2,272							DisplayName = new LocalizedString(eDeployTarget.Display, eDeployTarget.Display),273							RelatedPackages = (System.Collections.Generic.IEnumerable<RelatedPackage>)(_003C_003E8__1.assignedProducts.TryGetValue(text2, ref val4) ? val4 : new List<RelatedPackage>())274						};275					}));276					result2 = new XmlModuleWriter(_003CinstallModule_003E5__2)277					{278						IsRelease = true279					}.WriteToString();280					break;281					IL_00f9:282					result3 = val3.GetResult();283					_003CinstallModule_003E5__2 = null;284					if (eModule != null)285					{286						string text = eModule.GetValue("ModuleInfoXML");287						if (!string.IsNullOrWhiteSpace(text))288						{289							_003CinstallModule_003E5__2 = XmlModuleReader.ReadXmlString(text);290						}291					}292					if (_003CinstallModule_003E5__2 == null)293					{294						_003CinstallModule_003E5__2 = new InstallModule295						{296							Id = "CCC",297							DisplayName = new LocalizedString("CustomerModule", "Customer module"),298							Description = new LocalizedString("", ""),299							IsSelectable = false,300							ModuleVersion = new Version(1, 0)301						};302					}303					_003C_003E8__1.existingPackageIds = _003CinstallModule_003E5__2.Packages.ToDictionarySafe<Package, string, Guid>((Package p) => p.Name, (Package p) => p.Id);304					_003CinstallModule_003E5__2.Packages = (System.Collections.Generic.IEnumerable<Package>)Enumerable.ToList<Package>(Enumerable.Select<IEntity, Package>((System.Collections.Generic.IEnumerable<IEntity>)result3, (Func<IEntity, Package>)delegate(IEntity eFile)305					{306						//IL_0046: Unknown result type (might be due to invalid IL or missing references)307						//IL_003f: Unknown result type (might be due to invalid IL or missing references)308						string value = eFile.GetValue<string>("FileName");309						Package.File item = new Package.File(value, eFile.GetValue<bool>("IsToBackup"), eFile.GetValue<bool>("NeverUpdate"));310						Guid val4 = default(Guid);311						return new Package312						{313							Id = (_003C_003E8__1.existingPackageIds.TryGetValue(value, ref val4) ? val4 : Guid.NewGuid()),314							Name = value,315							DisplayName = new LocalizedString(value, value),316							Description = new LocalizedString("", ""),317							Files = (System.Collections.Generic.IReadOnlyList<Package.File>)new List<Package.File>((System.Collections.Generic.IEnumerable<Package.File>)new global::_003C_003Ez__ReadOnlySingleElementList<Package.File>(item)),318							SubDirectory = eFile.GetValue("SourceDirectory")319						};320					}));321					query2 = Query.From("QBMDeployTarget").Where("XObjectKey in (select ObjectKeyDeployTarget from QBMFileHasDeployTarget)").SelectAll();322					val3 = session.Source().GetCollectionAsync(query2, EntityCollectionLoadType.Default, ct).ConfigureAwait(false)323						.GetAwaiter();324					if (!val3.IsCompleted)325					{326						num = (_003C_003E1__state = 1);327						_003C_003Eu__1 = val3;328						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntityCollection>, _003CGetModuleInfoXml_003Ed__4>(ref val3, ref this);329						return;330					}331					goto IL_02a9;332					IL_02a9:333					result4 = val3.GetResult();334					_003CcolTargets_003E5__3 = result4;335					sqlStatement = "select t.FullPath, f.UID_QBMFileRevision, f.[FileName]\r\nfrom QBMDeployTarget t\r\njoin QBMFileHasDeployTarget fht on fht.ObjectKeyDeployTarget = t.XObjectKey\r\njoin QBMFileRevision f on fht.UID_QBMFileRevision = f.UID_QBMFileRevision";336					dbSession = session.Resolve<IDbSession>();337					obj = new Dictionary<string, InstallModule>((IEqualityComparer<string>)(object)StringComparer.OrdinalIgnoreCase);338					obj.Add("CCC", _003CinstallModule_003E5__2);339					_003CcachedModules_003E5__4 = obj;340					_003C_003E8__1.assignedProducts = new Dictionary<string, List<RelatedPackage>>((IEqualityComparer<string>)(object)StringComparer.OrdinalIgnoreCase);341					val2 = dbSession.SqlExecuteAsync(sqlStatement, ct).ConfigureAwait(false).GetAwaiter();342					if (!val2.IsCompleted)343					{344						num = (_003C_003E1__state = 2);345						_003C_003Eu__2 = val2;346						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<DbDataReader>, _003CGetModuleInfoXml_003Ed__4>(ref val2, ref this);347						return;348					}349					goto IL_036a;350				}351			}352			catch (System.Exception exception)353			{354				_003C_003E1__state = -2;355				_003C_003E8__1 = null;356				_003CinstallModule_003E5__2 = null;357				_003CcolTargets_003E5__3 = null;358				_003CcachedModules_003E5__4 = null;359				_003C_003Et__builder.SetException(exception);360				return;361			}362			_003C_003E1__state = -2;363			_003C_003E8__1 = null;364			_003CinstallModule_003E5__2 = null;365			_003CcolTargets_003E5__3 = null;366			_003CcachedModules_003E5__4 = null;367			_003C_003Et__builder.SetResult(result2);368		}369370		[DebuggerHidden]371		private void SetStateMachine(IAsyncStateMachine stateMachine)372		{373			_003C_003Et__builder.SetStateMachine(stateMachine);374		}375	}376377	[StructLayout((LayoutKind)3)]378	[CompilerGenerated]379	private struct _003CWriteModuleInfoXml_003Ed__3 : IAsyncStateMachine380	{381		public int _003C_003E1__state;382383		public AsyncTaskMethodBuilder _003C_003Et__builder;384385		public ISession session;386387		public CancellationToken ct;388389		private IEntity _003CeModule_003E5__2;390391		private ConfiguredTaskAwaiter<string> _003C_003Eu__1;392393		private void MoveNext()394		{395			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)396			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)397			//IL_00df: Unknown result type (might be due to invalid IL or missing references)398			//IL_0089: Unknown result type (might be due to invalid IL or missing references)399			//IL_0094: Unknown result type (might be due to invalid IL or missing references)400			//IL_0099: Unknown result type (might be due to invalid IL or missing references)401			//IL_009d: Unknown result type (might be due to invalid IL or missing references)402			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)403			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)404			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)405			int num = _003C_003E1__state;406			try407			{408				ConfiguredTaskAwaiter<string> val;409				if (num == 0)410				{411					val = _003C_003Eu__1;412					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<string>);413					num = (_003C_003E1__state = -1);414					goto IL_00ee;415				}416				Query query = (from c in Query.From("QBMModuleDef")417					where c.Column("ModuleName") == "CCC"418					select c).Select("ModuleInfoXML");419				IEntityCollection collection = session.Source().GetCollection(query, EntityCollectionLoadType.Bulk);420				if (((System.Collections.Generic.IReadOnlyCollection<IEntity>)collection).Count != 0)421				{422					_003CeModule_003E5__2 = ((System.Collections.Generic.IReadOnlyList<IEntity>)collection)[0];423					val = GetModuleInfoXml(session, _003CeModule_003E5__2, ct).ConfigureAwait(false).GetAwaiter();424					if (!val.IsCompleted)425					{426						num = (_003C_003E1__state = 0);427						_003C_003Eu__1 = val;428						((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<string>, _003CWriteModuleInfoXml_003Ed__3>(ref val, ref this);429						return;430					}431					goto IL_00ee;432				}433				goto end_IL_0007;434				IL_00ee:435				string result = val.GetResult();436				_003CeModule_003E5__2.PutValue("ModuleInfoXML", result);437				_003CeModule_003E5__2.Save(session);438				end_IL_0007:;439			}440			catch (System.Exception exception)441			{442				_003C_003E1__state = -2;443				_003CeModule_003E5__2 = null;444				((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);445				return;446			}447			_003C_003E1__state = -2;448			_003CeModule_003E5__2 = null;449			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();450		}451452		[DebuggerHidden]453		private void SetStateMachine(IAsyncStateMachine stateMachine)454		{455			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);456		}457	}458459	[StructLayout((LayoutKind)3)]460	[CompilerGenerated]461	private struct _003C_LoadModuleXmlAsync_003Ed__5 : IAsyncStateMachine462	{463		public int _003C_003E1__state;464465		public AsyncTaskMethodBuilder<InstallModule> _003C_003Et__builder;466467		public string name;468469		public Dictionary<string, InstallModule> cache;470471		public ISession session;472473		public CancellationToken cancellationToken;474475		private _003C_003Ec__DisplayClass5_0 _003C_003E8__1;476477		private ConfiguredTaskAwaiter<IEntityCollection> _003C_003Eu__1;478479		private void MoveNext()480		{481			//IL_00df: Unknown result type (might be due to invalid IL or missing references)482			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)483			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)484			//IL_0096: Unknown result type (might be due to invalid IL or missing references)485			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)486			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)487			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)488			//IL_00af: Unknown result type (might be due to invalid IL or missing references)489			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)490			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)491			int num = _003C_003E1__state;492			InstallModule result;493			try494			{495				ConfiguredTaskAwaiter<IEntityCollection> val;496				if (num == 0)497				{498					val = _003C_003Eu__1;499					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<IEntityCollection>);500					num = (_003C_003E1__state = -1);501					goto IL_00fb;502				}503				_003C_003E8__1 = new _003C_003Ec__DisplayClass5_0();504				_003C_003E8__1.name = name;505				InstallModule installModule = default(InstallModule);506				if (!cache.TryGetValue(_003C_003E8__1.name, ref installModule))507				{508					Query query = (from c in Query.From("QBMModuleDef")509						where c.Column("ModuleName") == _003C_003E8__1.name510						select c).Take(1).Select("ModuleInfoXML");511					val = session.Source().GetCollectionAsync(query, EntityCollectionLoadType.Slim, cancellationToken).ConfigureAwait(false)512						.GetAwaiter();513					if (!val.IsCompleted)514					{515						num = (_003C_003E1__state = 0);516						_003C_003Eu__1 = val;517						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntityCollection>, _003C_LoadModuleXmlAsync_003Ed__5>(ref val, ref this);518						return;519					}520					goto IL_00fb;521				}522				result = installModule;523				goto end_IL_0007;524				IL_00fb:525				IEntityCollection result2 = val.GetResult();526				if (((System.Collections.Generic.IReadOnlyCollection<IEntity>)result2).Count == 0)527				{528					result = null;529				}530				else531				{532					string value = ((System.Collections.Generic.IReadOnlyList<IEntity>)result2)[0].GetValue<string>("ModuleInfoXML");533					if (string.IsNullOrWhiteSpace(value))534					{535						result = null;536					}537					else538					{539						InstallModule installModule2 = XmlModuleReader.ReadXmlString(value);540						cache[_003C_003E8__1.name] = installModule2;541						result = installModule2;542					}543				}544				end_IL_0007:;545			}546			catch (System.Exception exception)547			{548				_003C_003E1__state = -2;549				_003C_003E8__1 = null;550				_003C_003Et__builder.SetException(exception);551				return;552			}553			_003C_003E1__state = -2;554			_003C_003E8__1 = null;555			_003C_003Et__builder.SetResult(result);556		}557558		[DebuggerHidden]559		private void SetStateMachine(IAsyncStateMachine stateMachine)560		{561			_003C_003Et__builder.SetStateMachine(stateMachine);562		}563	}564565	[StructLayout((LayoutKind)3)]566	[CompilerGenerated]567	private struct _003C_UpdateModuleInfoXmlAsync_003Ed__1 : IAsyncStateMachine568	{569		public int _003C_003E1__state;570571		public AsyncTaskMethodBuilder _003C_003Et__builder;572573		public ISession session;574575		public IEntity entity;576577		public CancellationToken ct;578579		private ConfiguredTaskAwaiter<string> _003C_003Eu__1;580581		private ConfiguredValueTaskAwaiter<ApplyResult> _003C_003Eu__2;582583		private void MoveNext()584		{585			//IL_0064: Unknown result type (might be due to invalid IL or missing references)586			//IL_0069: Unknown result type (might be due to invalid IL or missing references)587			//IL_0070: Unknown result type (might be due to invalid IL or missing references)588			//IL_009f: Unknown result type (might be due to invalid IL or missing references)589			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)590			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)591			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)592			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)593			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)594			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)595			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)596			//IL_001e: Unknown result type (might be due to invalid IL or missing references)597			//IL_0029: Unknown result type (might be due to invalid IL or missing references)598			//IL_002e: Unknown result type (might be due to invalid IL or missing references)599			//IL_0031: Unknown result type (might be due to invalid IL or missing references)600			//IL_0036: Unknown result type (might be due to invalid IL or missing references)601			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)602			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)603			//IL_004a: Unknown result type (might be due to invalid IL or missing references)604			//IL_004b: Unknown result type (might be due to invalid IL or missing references)605			int num = _003C_003E1__state;606			try607			{608				ConfiguredValueTaskAwaiter<ApplyResult> val;609				ConfiguredTaskAwaiter<string> val2;610				if (num != 0)611				{612					if (num == 1)613					{614						val = _003C_003Eu__2;615						_003C_003Eu__2 = default(ConfiguredValueTaskAwaiter<ApplyResult>);616						num = (_003C_003E1__state = -1);617						goto IL_0105;618					}619					val2 = GetModuleInfoXml(session, entity, ct).ConfigureAwait(false).GetAwaiter();620					if (!val2.IsCompleted)621					{622						num = (_003C_003E1__state = 0);623						_003C_003Eu__1 = val2;624						((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<string>, _003C_UpdateModuleInfoXmlAsync_003Ed__1>(ref val2, ref this);625						return;626					}627				}628				else629				{630					val2 = _003C_003Eu__1;631					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<string>);632					num = (_003C_003E1__state = -1);633				}634				string result = val2.GetResult();635				val = entity.Columns["ModuleInfoXML"].SetValueAsync(result, SetValueBehavior.Default, ct).ConfigureAwait(false).GetAwaiter();636				if (!val.IsCompleted)637				{638					num = (_003C_003E1__state = 1);639					_003C_003Eu__2 = val;640					((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<ApplyResult>, _003C_UpdateModuleInfoXmlAsync_003Ed__1>(ref val, ref this);641					return;642				}643				goto IL_0105;644				IL_0105:645				val.GetResult();646			}647			catch (System.Exception exception)648			{649				_003C_003E1__state = -2;650				((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);651				return;652			}653			_003C_003E1__state = -2;654			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();655		}656657		[DebuggerHidden]658		private void SetStateMachine(IAsyncStateMachine stateMachine)659		{660			((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);661		}662	}663664	public const string PreCommitName = "QBMModuleDef.WriteModuleInfoXml";665666	public QBMModuleDef()667	{668		RegisterExpensive("_IsCCC").DependsOn("UID_ModuleDef").As<bool>((Func<ISession, IEntity, CancellationToken, System.Threading.Tasks.Task<bool>>)([AsyncStateMachine(typeof(_003C_003Ec._003C_003C_002Dctor_003Eb__0_0_003Ed))] async (ISession s, IEntity e, CancellationToken ct) => Uid.IsCustom(await e.Columns["UID_ModuleDef"].GetValueAsync<string>(ct).ConfigureAwait(false))));669		CanEdit("ModuleInfoXml").From("_IsCCC", "SPECIAL(IsTransport)").As<bool, bool>((Func<bool, bool, bool>)((bool isCCC, bool isTransport) => isCCC || isTransport));670		RegisterMethod("UpdateModuleInfoXML").As([AsyncStateMachine(typeof(_003C_003Ec._003C_003C_002Dctor_003Eb__0_2_003Ed))] (ISession session, IEntity entity, CancellationToken ct) =>671		{672			//IL_0002: Unknown result type (might be due to invalid IL or missing references)673			//IL_0007: Unknown result type (might be due to invalid IL or missing references)674			//IL_001e: Unknown result type (might be due to invalid IL or missing references)675			//IL_001f: Unknown result type (might be due to invalid IL or missing references)676			_003C_003Ec._003C_003C_002Dctor_003Eb__0_2_003Ed _003C_003C_002Dctor_003Eb__0_2_003Ed = default(_003C_003Ec._003C_003C_002Dctor_003Eb__0_2_003Ed);677			_003C_003C_002Dctor_003Eb__0_2_003Ed._003C_003Et__builder = AsyncTaskMethodBuilder.Create();678			_003C_003C_002Dctor_003Eb__0_2_003Ed.session = session;679			_003C_003C_002Dctor_003Eb__0_2_003Ed.entity = entity;680			_003C_003C_002Dctor_003Eb__0_2_003Ed.ct = ct;681			_003C_003C_002Dctor_003Eb__0_2_003Ed._003C_003E1__state = -1;682			((AsyncTaskMethodBuilder)(ref _003C_003C_002Dctor_003Eb__0_2_003Ed._003C_003Et__builder)).Start<_003C_003Ec._003C_003C_002Dctor_003Eb__0_2_003Ed>(ref _003C_003C_002Dctor_003Eb__0_2_003Ed);683			return ((AsyncTaskMethodBuilder)(ref _003C_003C_002Dctor_003Eb__0_2_003Ed._003C_003Et__builder)).Task;684		}).Enabled().From("_IsCCC")685			.As<bool>((Func<bool, bool>)((bool isCCC) => isCCC))686			.Visible()687			.From("_IsCCC")688			.As<bool>((Func<bool, bool>)((bool isCCC) => isCCC))689			.Description(" ")690			.Behavior(MethodBehavior.SaveRequired | MethodBehavior.SingleObject);691	}692693	[AsyncStateMachine(typeof(_003C_UpdateModuleInfoXmlAsync_003Ed__1))]694	private static System.Threading.Tasks.Task _UpdateModuleInfoXmlAsync(ISession session, IEntity entity, CancellationToken ct)695	{696		//IL_0002: Unknown result type (might be due to invalid IL or missing references)697		//IL_0007: Unknown result type (might be due to invalid IL or missing references)698		//IL_001e: Unknown result type (might be due to invalid IL or missing references)699		//IL_001f: Unknown result type (might be due to invalid IL or missing references)700		_003C_UpdateModuleInfoXmlAsync_003Ed__1 _003C_UpdateModuleInfoXmlAsync_003Ed__ = default(_003C_UpdateModuleInfoXmlAsync_003Ed__1);701		_003C_UpdateModuleInfoXmlAsync_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();702		_003C_UpdateModuleInfoXmlAsync_003Ed__.session = session;703		_003C_UpdateModuleInfoXmlAsync_003Ed__.entity = entity;704		_003C_UpdateModuleInfoXmlAsync_003Ed__.ct = ct;705		_003C_UpdateModuleInfoXmlAsync_003Ed__._003C_003E1__state = -1;706		((AsyncTaskMethodBuilder)(ref _003C_UpdateModuleInfoXmlAsync_003Ed__._003C_003Et__builder)).Start<_003C_UpdateModuleInfoXmlAsync_003Ed__1>(ref _003C_UpdateModuleInfoXmlAsync_003Ed__);707		return ((AsyncTaskMethodBuilder)(ref _003C_UpdateModuleInfoXmlAsync_003Ed__._003C_003Et__builder)).Task;708	}709710	[AsyncStateMachine(typeof(_003CWriteModuleInfoXml_003Ed__3))]711	public static System.Threading.Tasks.Task WriteModuleInfoXml(ISession session, System.Collections.Generic.IReadOnlyList<string> readOnlyList, CancellationToken ct)712	{713		//IL_0002: Unknown result type (might be due to invalid IL or missing references)714		//IL_0007: Unknown result type (might be due to invalid IL or missing references)715		//IL_0016: Unknown result type (might be due to invalid IL or missing references)716		//IL_0017: Unknown result type (might be due to invalid IL or missing references)717		_003CWriteModuleInfoXml_003Ed__3 _003CWriteModuleInfoXml_003Ed__ = default(_003CWriteModuleInfoXml_003Ed__3);718		_003CWriteModuleInfoXml_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();719		_003CWriteModuleInfoXml_003Ed__.session = session;720		_003CWriteModuleInfoXml_003Ed__.ct = ct;721		_003CWriteModuleInfoXml_003Ed__._003C_003E1__state = -1;722		((AsyncTaskMethodBuilder)(ref _003CWriteModuleInfoXml_003Ed__._003C_003Et__builder)).Start<_003CWriteModuleInfoXml_003Ed__3>(ref _003CWriteModuleInfoXml_003Ed__);723		return ((AsyncTaskMethodBuilder)(ref _003CWriteModuleInfoXml_003Ed__._003C_003Et__builder)).Task;724	}725726	[AsyncStateMachine(typeof(_003CGetModuleInfoXml_003Ed__4))]727	private static async System.Threading.Tasks.Task<string> GetModuleInfoXml(ISession session, IEntity eModule, CancellationToken ct)728	{729		//IL_0002: Unknown result type (might be due to invalid IL or missing references)730		//IL_0007: Unknown result type (might be due to invalid IL or missing references)731		//IL_001e: Unknown result type (might be due to invalid IL or missing references)732		//IL_001f: Unknown result type (might be due to invalid IL or missing references)733		Query query = (from t in Query.From("QBMFileRevision")734			where t.Column("UID_QBMFileRevision").StartsWith("CCC-")735			select t).Select("FileName", "IsToBackup", "NeverUpdate", "SourceDirectory");736		IEntityCollection entityCollection = await session.Source().GetCollectionAsync(query, EntityCollectionLoadType.Slim, ct).ConfigureAwait(false);737		InstallModule installModule = null;738		if (eModule != null)739		{740			string text = eModule.GetValue("ModuleInfoXML");741			if (!string.IsNullOrWhiteSpace(text))742			{743				installModule = XmlModuleReader.ReadXmlString(text);744			}745		}746		if (installModule == null)747		{748			installModule = new InstallModule749			{750				Id = "CCC",751				DisplayName = new LocalizedString("CustomerModule", "Customer module"),752				Description = new LocalizedString("", ""),753				IsSelectable = false,754				ModuleVersion = new Version(1, 0)755			};756		}757		Dictionary<string, Guid> existingPackageIds = installModule.Packages.ToDictionarySafe<Package, string, Guid>((Package p) => p.Name, (Package p) => p.Id);758		installModule.Packages = (System.Collections.Generic.IEnumerable<Package>)Enumerable.ToList<Package>(Enumerable.Select<IEntity, Package>((System.Collections.Generic.IEnumerable<IEntity>)entityCollection, (Func<IEntity, Package>)delegate(IEntity eFile)759		{760			//IL_0046: Unknown result type (might be due to invalid IL or missing references)761			//IL_003f: Unknown result type (might be due to invalid IL or missing references)762			string value = eFile.GetValue<string>("FileName");763			Package.File item = new Package.File(value, eFile.GetValue<bool>("IsToBackup"), eFile.GetValue<bool>("NeverUpdate"));764			Guid val = default(Guid);765			return new Package766			{767				Id = (existingPackageIds.TryGetValue(value, ref val) ? val : Guid.NewGuid()),768				Name = value,769				DisplayName = new LocalizedString(value, value),770				Description = new LocalizedString("", ""),771				Files = (System.Collections.Generic.IReadOnlyList<Package.File>)new List<Package.File>((System.Collections.Generic.IEnumerable<Package.File>)new global::_003C_003Ez__ReadOnlySingleElementList<Package.File>(item)),772				SubDirectory = eFile.GetValue("SourceDirectory")773			};774		}));775		Query query2 = Query.From("QBMDeployTarget").Where("XObjectKey in (select ObjectKeyDeployTarget from QBMFileHasDeployTarget)").SelectAll();776		IEntityCollection colTargets = await session.Source().GetCollectionAsync(query2, EntityCollectionLoadType.Default, ct).ConfigureAwait(false);777		string sqlStatement = "select t.FullPath, f.UID_QBMFileRevision, f.[FileName]\r\nfrom QBMDeployTarget t\r\njoin QBMFileHasDeployTarget fht on fht.ObjectKeyDeployTarget = t.XObjectKey\r\njoin QBMFileRevision f on fht.UID_QBMFileRevision = f.UID_QBMFileRevision";778		IDbSession dbSession = session.Resolve<IDbSession>();779		Dictionary<string, InstallModule> obj = new Dictionary<string, InstallModule>((IEqualityComparer<string>)(object)StringComparer.OrdinalIgnoreCase);780		obj.Add("CCC", installModule);781		Dictionary<string, InstallModule> cachedModules = obj;782		Dictionary<string, List<RelatedPackage>> assignedProducts = new Dictionary<string, List<RelatedPackage>>((IEqualityComparer<string>)(object)StringComparer.OrdinalIgnoreCase);783		var array = Enumerable.ToArray(Enumerable.Select(((IDataReader)(object)(await dbSession.SqlExecuteAsync(sqlStatement, ct).ConfigureAwait(false))).FetchAll(), (IDataRecord r) => new784		{785			FullPath = r.GetString(0),786			ModuleId = Uid.GetModuleOwner(r.GetString(1)),787			FileName = r.GetString(2)788		}));789		var array2 = array;790		foreach (var f in array2)791		{792			InstallModule installModule2 = await _LoadModuleXmlAsync(cachedModules, session, f.ModuleId, ct).ConfigureAwait(false);793			if (installModule2 == null)794			{795				continue;796			}797			Package package = Enumerable.FirstOrDefault<Package>(installModule2.Packages, (Func<Package, bool>)((Package p) => Enumerable.Any<Package.File>((System.Collections.Generic.IEnumerable<Package.File>)p.Files, (Func<Package.File, bool>)((Package.File fi) => string.Equals(fi.Fullname, f.FileName, (StringComparison)5)))));798			if (package != null)799			{800				RelatedPackage relatedPackage = new RelatedPackage(f.ModuleId, package.Name);801				((IDictionary<string, List<RelatedPackage>>)(object)assignedProducts).GetOrAdd<string, List<RelatedPackage>>(f.FullPath, (string _) => new List<RelatedPackage>()).Add(relatedPackage);802			}803		}804		installModule.DeploymentTargets = (System.Collections.Generic.IEnumerable<DeploymentTarget>)Enumerable.ToList<DeploymentTarget>(Enumerable.Select<IEntity, DeploymentTarget>((System.Collections.Generic.IEnumerable<IEntity>)colTargets, (Func<IEntity, DeploymentTarget>)delegate(IEntity eDeployTarget)805		{806			string text2 = eDeployTarget.GetValue("FullPath");807			List<RelatedPackage> val = default(List<RelatedPackage>);808			return new DeploymentTarget809			{810				FullPath = text2,811				DisplayName = new LocalizedString(eDeployTarget.Display, eDeployTarget.Display),812				RelatedPackages = (System.Collections.Generic.IEnumerable<RelatedPackage>)(assignedProducts.TryGetValue(text2, ref val) ? val : new List<RelatedPackage>())813			};814		}));815		return new XmlModuleWriter(installModule)816		{817			IsRelease = true818		}.WriteToString();819	}820821	[AsyncStateMachine(typeof(_003C_LoadModuleXmlAsync_003Ed__5))]822	private static async System.Threading.Tasks.Task<InstallModule?> _LoadModuleXmlAsync(Dictionary<string, InstallModule> cache, ISession session, string name, CancellationToken cancellationToken)823	{824		//IL_0002: Unknown result type (might be due to invalid IL or missing references)825		//IL_0007: Unknown result type (might be due to invalid IL or missing references)826		//IL_0026: Unknown result type (might be due to invalid IL or missing references)827		//IL_0027: Unknown result type (might be due to invalid IL or missing references)828		InstallModule result = default(InstallModule);829		if (cache.TryGetValue(name, ref result))830		{831			return result;832		}833		Query query = (from c in Query.From("QBMModuleDef")834			where c.Column("ModuleName") == name835			select c).Take(1).Select("ModuleInfoXML");836		IEntityCollection entityCollection = await session.Source().GetCollectionAsync(query, EntityCollectionLoadType.Slim, cancellationToken).ConfigureAwait(false);837		if (((System.Collections.Generic.IReadOnlyCollection<IEntity>)entityCollection).Count == 0)838		{839			return null;840		}841		string value = ((System.Collections.Generic.IReadOnlyList<IEntity>)entityCollection)[0].GetValue<string>("ModuleInfoXML");842		if (string.IsNullOrWhiteSpace(value))843		{844			return null;845		}846		InstallModule installModule = XmlModuleReader.ReadXmlString(value);847		cache[name] = installModule;848		return installModule;849	}850}851