Back to OIM Explorer

QER.CompositionApi/QER.CompositionApi.History/UnsubscribePwoAction.cs

Decompiler Source FileQER.CompositionApi.UnsubscribePwoActionDecompiled Source

2 extracted method/event/call references in UnsubscribePwoAction.

Source: F:\Claude\.tmp\oim-decompiled-full\0989_One_Identity_Manager_QER.CompositionApi.dll\QER.CompositionApi.History\UnsubscribePwoAction.cs

Source size: 27.978 characters

Interpretation

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

Relations

  • CallMethodAsync: Unsubscribe at line 187
  • CallMethodAsync: Unsubscribe at line 604

Typed Edges

  • No typed edges extracted for this source.

References

  • No direct source references extracted.

Referenced By

  • No direct source references extracted.

C# source-derived context

Generated by pattern extraction from the decompiled C# source and decompile index. This is factual source evidence, not inferred behavior.

reads entity values references DB/Dialog objects IT Shop related markers

Summary: classes UnsubscribePwoAction; methods MoveNext, SetStateMachine, ExecuteAsync, ToSerializableActionAsync, FromAssignmentKeyAsync, FromUidPwoAsync; references Delegation, Person, PersonWantsOrg, QERJustification; markers reads entity values, references DB/Dialog objects, IT Shop related markers

Classes

UnsubscribePwoAction

OIM key/entity markers

UID_PersonWantsOrg ObjectKeyAssignment

API/entity calls

GetValue ExistsAsync Source SqlFormatter From

Registrations / handlers

None extracted.

Complete Source

C#711 lines
1using System;2using System.Collections;3using System.Collections.Generic;4using System.Diagnostics;5using System.Runtime.CompilerServices;6using System.Runtime.InteropServices;7using System.Threading;8using System.Threading.Tasks;9using QBM.CompositionApi;10using QBM.CompositionApi.UiAction;11using QER.CompositionApi.AutoRemoval;12using VI.Base;13using VI.DB;14using VI.DB.Entities;1516namespace QER.CompositionApi.History;1718public class UnsubscribePwoAction : IUiAction19{20	[StructLayout((LayoutKind)3)]21	[CompilerGenerated]22	private struct _003CBuildActionDisplayAsync_003Ed__32 : IAsyncStateMachine23	{24		public int _003C_003E1__state;2526		public AsyncTaskMethodBuilder<string> _003C_003Et__builder;2728		public ITranslator translator;2930		public TranslatableKey messageKey;3132		public IEntity pwo;3334		public ISession session;3536		public CancellationToken ct;3738		private List<string> _003Cmessages_003E5__2;3940		private ConfiguredTaskAwaiter<bool> _003C_003Eu__1;4142		private void MoveNext()43		{44			//IL_011c: Unknown result type (might be due to invalid IL or missing references)45			//IL_0121: Unknown result type (might be due to invalid IL or missing references)46			//IL_0129: Unknown result type (might be due to invalid IL or missing references)47			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)48			//IL_00de: Unknown result type (might be due to invalid IL or missing references)49			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)50			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)51			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)52			//IL_0101: Unknown result type (might be due to invalid IL or missing references)53			//IL_0103: Unknown result type (might be due to invalid IL or missing references)54			int num = _003C_003E1__state;55			string result;56			try57			{58				ConfiguredTaskAwaiter<bool> val;59				if (num != 0)60				{61					List<string> obj = new List<string>();62					obj.Add(translator.TranslateControlText(messageKey ?? AdditionalKeys.UnsubscribingRequest));63					_003Cmessages_003E5__2 = obj;64					System.DateTime date = pwo.GetValue("ValidUntil").Date;65					if (date > System.DateTime.UtcNow)66					{67						_003Cmessages_003E5__2.Add(string.Format(translator.TranslateControlText(TranslatableKeys.AssignmentRequestValidUntil), (object)DbVal.FromUniversalTime(date, session.TimeZone).ToShortDateString()));68					}69					DbVal value = pwo.GetValue("UID_PersonWantsOrg");70					val = session.Source().ExistsAsync("Delegation", session.SqlFormatter().UidComparison("UID_PersonWantsOrg", value), ct).ConfigureAwait(false)71						.GetAwaiter();72					if (!val.IsCompleted)73					{74						num = (_003C_003E1__state = 0);75						_003C_003Eu__1 = val;76						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<bool>, _003CBuildActionDisplayAsync_003Ed__32>(ref val, ref this);77						return;78					}79				}80				else81				{82					val = _003C_003Eu__1;83					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<bool>);84					num = (_003C_003E1__state = -1);85				}86				if (val.GetResult())87				{88					_003Cmessages_003E5__2.Add(string.Format(translator.TranslateControlText(TranslatableKeys.AssignmentRequestDelegatedFrom), (object)pwo.GetValue("DisplayPersonInserted")));89				}90				result = string.Join(". ", (System.Collections.Generic.IEnumerable<string>)((System.Collections.Generic.IReadOnlyList<string>)_003Cmessages_003E5__2).Select<string, string>((string m) => m.TrimEnd('.')));91			}92			catch (System.Exception exception)93			{94				_003C_003E1__state = -2;95				_003Cmessages_003E5__2 = null;96				_003C_003Et__builder.SetException(exception);97				return;98			}99			_003C_003E1__state = -2;100			_003Cmessages_003E5__2 = null;101			_003C_003Et__builder.SetResult(result);102		}103104		[DebuggerHidden]105		private void SetStateMachine(IAsyncStateMachine stateMachine)106		{107			_003C_003Et__builder.SetStateMachine(stateMachine);108		}109	}110111	[StructLayout((LayoutKind)3)]112	[CompilerGenerated]113	private struct _003CExecuteAsync_003Ed__28 : IAsyncStateMachine114	{115		public int _003C_003E1__state;116117		public AsyncTaskMethodBuilder<System.Collections.Generic.IEnumerable<IEntity>> _003C_003Et__builder;118119		public IUiActionContext context;120121		public UnsubscribePwoAction _003C_003E4__this;122123		public CancellationToken ct;124125		private IEntity _003Cpwo_003E5__2;126127		private ConfiguredTaskAwaiter<IEntity> _003C_003Eu__1;128129		private ConfiguredValueTaskAwaiter _003C_003Eu__2;130131		private void MoveNext()132		{133			//IL_0083: Unknown result type (might be due to invalid IL or missing references)134			//IL_0088: Unknown result type (might be due to invalid IL or missing references)135			//IL_0090: Unknown result type (might be due to invalid IL or missing references)136			//IL_011f: Unknown result type (might be due to invalid IL or missing references)137			//IL_0124: Unknown result type (might be due to invalid IL or missing references)138			//IL_012c: Unknown result type (might be due to invalid IL or missing references)139			//IL_003a: Unknown result type (might be due to invalid IL or missing references)140			//IL_0045: Unknown result type (might be due to invalid IL or missing references)141			//IL_004a: Unknown result type (might be due to invalid IL or missing references)142			//IL_004e: Unknown result type (might be due to invalid IL or missing references)143			//IL_0053: Unknown result type (might be due to invalid IL or missing references)144			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)145			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)146			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)147			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)148			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)149			//IL_0068: Unknown result type (might be due to invalid IL or missing references)150			//IL_006a: Unknown result type (might be due to invalid IL or missing references)151			//IL_0107: Unknown result type (might be due to invalid IL or missing references)152			//IL_0109: Unknown result type (might be due to invalid IL or missing references)153			int num = _003C_003E1__state;154			UnsubscribePwoAction unsubscribePwoAction = _003C_003E4__this;155			System.Collections.Generic.IEnumerable<IEntity> result2;156			try157			{158				ConfiguredValueTaskAwaiter val;159				ConfiguredTaskAwaiter<IEntity> val2;160				if (num != 0)161				{162					if (num == 1)163					{164						val = _003C_003Eu__2;165						_003C_003Eu__2 = default(ConfiguredValueTaskAwaiter);166						num = (_003C_003E1__state = -1);167						goto IL_013b;168					}169					val2 = context.Session.Source().GetAsync(new DbObjectKey("PersonWantsOrg", unsubscribePwoAction.UidPwo), EntityLoadType.DelayedLogic, ct).ConfigureAwait(false)170						.GetAwaiter();171					if (!val2.IsCompleted)172					{173						num = (_003C_003E1__state = 0);174						_003C_003Eu__1 = val2;175						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntity>, _003CExecuteAsync_003Ed__28>(ref val2, ref this);176						return;177					}178				}179				else180				{181					val2 = _003C_003Eu__1;182					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<IEntity>);183					num = (_003C_003E1__state = -1);184				}185				IEntity result = val2.GetResult();186				_003Cpwo_003E5__2 = result;187				ConfiguredValueTaskAwaitable val3 = _003Cpwo_003E5__2.CallMethodAsync("Unsubscribe", unsubscribePwoAction.UidPersonForUnsubscribe, unsubscribePwoAction.Reason ?? string.Empty, unsubscribePwoAction.UidQerJustification, ct).ConfigureAwait(false);188				val = ((ConfiguredValueTaskAwaitable)(ref val3)).GetAwaiter();189				if (!((ConfiguredValueTaskAwaiter)(ref val)).IsCompleted)190				{191					num = (_003C_003E1__state = 1);192					_003C_003Eu__2 = val;193					_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter, _003CExecuteAsync_003Ed__28>(ref val, ref this);194					return;195				}196				goto IL_013b;197				IL_013b:198				((ConfiguredValueTaskAwaiter)(ref val)).GetResult();199				result2 = new IEntity[1] { _003Cpwo_003E5__2 };200			}201			catch (System.Exception exception)202			{203				_003C_003E1__state = -2;204				_003Cpwo_003E5__2 = null;205				_003C_003Et__builder.SetException(exception);206				return;207			}208			_003C_003E1__state = -2;209			_003Cpwo_003E5__2 = null;210			_003C_003Et__builder.SetResult(result2);211		}212213		[DebuggerHidden]214		private void SetStateMachine(IAsyncStateMachine stateMachine)215		{216			_003C_003Et__builder.SetStateMachine(stateMachine);217		}218	}219220	[StructLayout((LayoutKind)3)]221	[CompilerGenerated]222	private struct _003CFromAssignmentKeyAsync_003Ed__30 : IAsyncStateMachine223	{224		public int _003C_003E1__state;225226		public AsyncTaskMethodBuilder<System.Collections.Generic.IEnumerable<UnsubscribePwoAction>> _003C_003Et__builder;227228		public ISession session;229230		public string objectKeyAssignment;231232		public CancellationToken ct;233234		public ITranslator translator;235236		public TranslatableKey messageKey;237238		public string objectDisplay;239240		public string id;241242		public string reason;243244		public string uidPersonForUnsubscribe;245246		public string uidQerJustification;247248		private List<UnsubscribePwoAction> _003Cresult_003E5__2;249250		private ConfiguredTaskAwaiter<IEntityCollection> _003C_003Eu__1;251252		private System.Collections.Generic.IEnumerator<IEntity> _003C_003E7__wrap2;253254		private string _003CuidPwo_003E5__4;255256		private ConfiguredTaskAwaiter<string> _003C_003Eu__2;257258		private void MoveNext()259		{260			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)261			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)262			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)263			//IL_006d: Unknown result type (might be due to invalid IL or missing references)264			//IL_0078: Unknown result type (might be due to invalid IL or missing references)265			//IL_007d: Unknown result type (might be due to invalid IL or missing references)266			//IL_0081: Unknown result type (might be due to invalid IL or missing references)267			//IL_0086: Unknown result type (might be due to invalid IL or missing references)268			//IL_009b: Unknown result type (might be due to invalid IL or missing references)269			//IL_009d: Unknown result type (might be due to invalid IL or missing references)270			//IL_0182: Unknown result type (might be due to invalid IL or missing references)271			//IL_0187: Unknown result type (might be due to invalid IL or missing references)272			//IL_018f: Unknown result type (might be due to invalid IL or missing references)273			//IL_0139: Unknown result type (might be due to invalid IL or missing references)274			//IL_0144: Unknown result type (might be due to invalid IL or missing references)275			//IL_0149: Unknown result type (might be due to invalid IL or missing references)276			//IL_014d: Unknown result type (might be due to invalid IL or missing references)277			//IL_0152: Unknown result type (might be due to invalid IL or missing references)278			//IL_0167: Unknown result type (might be due to invalid IL or missing references)279			//IL_0169: Unknown result type (might be due to invalid IL or missing references)280			int num = _003C_003E1__state;281			System.Collections.Generic.IEnumerable<UnsubscribePwoAction> result3;282			try283			{284				ConfiguredTaskAwaiter<IEntityCollection> val;285				if (num != 0)286				{287					if (num == 1)288					{289						goto IL_00f4;290					}291					string whereClause = session.SqlFormatter().UidComparison("ObjectKeyAssignment", objectKeyAssignment);292					Query query = Query.From("PersonWantsOrg").SelectDisplays().Where(whereClause)293						.Where(AutoRemovalEnvironment.GetOrderStateWhereClause(session));294					val = session.Source().GetCollectionAsync(query, EntityCollectionLoadType.BulkReadOnly, ct).ConfigureAwait(false)295						.GetAwaiter();296					if (!val.IsCompleted)297					{298						num = (_003C_003E1__state = 0);299						_003C_003Eu__1 = val;300						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntityCollection>, _003CFromAssignmentKeyAsync_003Ed__30>(ref val, ref this);301						return;302					}303				}304				else305				{306					val = _003C_003Eu__1;307					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<IEntityCollection>);308					num = (_003C_003E1__state = -1);309				}310				IEntityCollection result = val.GetResult();311				_003Cresult_003E5__2 = new List<UnsubscribePwoAction>();312				_003C_003E7__wrap2 = ((System.Collections.Generic.IEnumerable<IEntity>)result).GetEnumerator();313				goto IL_00f4;314				IL_00f4:315				try316				{317					if (num != 1)318					{319						goto IL_01f6;320					}321					ConfiguredTaskAwaiter<string> val2 = _003C_003Eu__2;322					_003C_003Eu__2 = default(ConfiguredTaskAwaiter<string>);323					num = (_003C_003E1__state = -1);324					goto IL_019e;325					IL_019e:326					string result2 = val2.GetResult();327					_003Cresult_003E5__2.Add(new UnsubscribePwoAction(_003CuidPwo_003E5__4, objectDisplay, result2, id)328					{329						Reason = reason,330						UidPersonForUnsubscribe = uidPersonForUnsubscribe,331						UidQerJustification = uidQerJustification332					});333					_003CuidPwo_003E5__4 = null;334					goto IL_01f6;335					IL_01f6:336					if (((System.Collections.IEnumerator)_003C_003E7__wrap2).MoveNext())337					{338						IEntity current = _003C_003E7__wrap2.Current;339						_003CuidPwo_003E5__4 = current.GetValue("UID_PersonWantsOrg").String;340						val2 = BuildActionDisplayAsync(current, session, translator, messageKey, ct).ConfigureAwait(false).GetAwaiter();341						if (!val2.IsCompleted)342						{343							num = (_003C_003E1__state = 1);344							_003C_003Eu__2 = val2;345							_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<string>, _003CFromAssignmentKeyAsync_003Ed__30>(ref val2, ref this);346							return;347						}348						goto IL_019e;349					}350				}351				finally352				{353					if (num < 0 && _003C_003E7__wrap2 != null)354					{355						((System.IDisposable)_003C_003E7__wrap2).Dispose();356					}357				}358				_003C_003E7__wrap2 = null;359				result3 = (System.Collections.Generic.IEnumerable<UnsubscribePwoAction>)_003Cresult_003E5__2;360			}361			catch (System.Exception exception)362			{363				_003C_003E1__state = -2;364				_003Cresult_003E5__2 = null;365				_003C_003Et__builder.SetException(exception);366				return;367			}368			_003C_003E1__state = -2;369			_003Cresult_003E5__2 = null;370			_003C_003Et__builder.SetResult(result3);371		}372373		[DebuggerHidden]374		private void SetStateMachine(IAsyncStateMachine stateMachine)375		{376			_003C_003Et__builder.SetStateMachine(stateMachine);377		}378	}379380	[StructLayout((LayoutKind)3)]381	[CompilerGenerated]382	private struct _003CFromUidPwoAsync_003Ed__31 : IAsyncStateMachine383	{384		public int _003C_003E1__state;385386		public AsyncTaskMethodBuilder<UnsubscribePwoAction> _003C_003Et__builder;387388		public string uidPwo;389390		public ISession session;391392		public CancellationToken ct;393394		public ITranslator translator;395396		public TranslatableKey messageKey;397398		public string id;399400		public string reason;401402		public string uidPersonForUnsubscribe;403404		public string uidQerJustification;405406		private IEntity _003Cpwo_003E5__2;407408		private ConfiguredTaskAwaiter<IEntity> _003C_003Eu__1;409410		private ConfiguredTaskAwaiter<string> _003C_003Eu__2;411412		private void MoveNext()413		{414			//IL_0079: Unknown result type (might be due to invalid IL or missing references)415			//IL_007e: Unknown result type (might be due to invalid IL or missing references)416			//IL_0086: Unknown result type (might be due to invalid IL or missing references)417			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)418			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)419			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)420			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)421			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)422			//IL_0108: Unknown result type (might be due to invalid IL or missing references)423			//IL_010d: Unknown result type (might be due to invalid IL or missing references)424			//IL_0115: Unknown result type (might be due to invalid IL or missing references)425			//IL_0030: Unknown result type (might be due to invalid IL or missing references)426			//IL_003b: Unknown result type (might be due to invalid IL or missing references)427			//IL_0040: Unknown result type (might be due to invalid IL or missing references)428			//IL_0044: Unknown result type (might be due to invalid IL or missing references)429			//IL_0049: Unknown result type (might be due to invalid IL or missing references)430			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)431			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)432			//IL_005e: Unknown result type (might be due to invalid IL or missing references)433			//IL_0060: Unknown result type (might be due to invalid IL or missing references)434			int num = _003C_003E1__state;435			UnsubscribePwoAction result3;436			try437			{438				ConfiguredTaskAwaiter<string> val;439				ConfiguredTaskAwaiter<IEntity> val2;440				if (num != 0)441				{442					if (num == 1)443					{444						val = _003C_003Eu__2;445						_003C_003Eu__2 = default(ConfiguredTaskAwaiter<string>);446						num = (_003C_003E1__state = -1);447						goto IL_0124;448					}449					DbObjectKey key = new DbObjectKey("PersonWantsOrg", uidPwo);450					val2 = session.Source().GetAsync(key, EntityLoadType.ReadOnly, ct).ConfigureAwait(false)451						.GetAwaiter();452					if (!val2.IsCompleted)453					{454						num = (_003C_003E1__state = 0);455						_003C_003Eu__1 = val2;456						_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<IEntity>, _003CFromUidPwoAsync_003Ed__31>(ref val2, ref this);457						return;458					}459				}460				else461				{462					val2 = _003C_003Eu__1;463					_003C_003Eu__1 = default(ConfiguredTaskAwaiter<IEntity>);464					num = (_003C_003E1__state = -1);465				}466				IEntity result = val2.GetResult();467				_003Cpwo_003E5__2 = result;468				val = BuildActionDisplayAsync(_003Cpwo_003E5__2, session, translator, messageKey, ct).ConfigureAwait(false).GetAwaiter();469				if (!val.IsCompleted)470				{471					num = (_003C_003E1__state = 1);472					_003C_003Eu__2 = val;473					_003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<string>, _003CFromUidPwoAsync_003Ed__31>(ref val, ref this);474					return;475				}476				goto IL_0124;477				IL_0124:478				string result2 = val.GetResult();479				result3 = new UnsubscribePwoAction(uidPwo, _003Cpwo_003E5__2.Display, result2, id)480				{481					Reason = reason,482					UidPersonForUnsubscribe = uidPersonForUnsubscribe,483					UidQerJustification = uidQerJustification484				};485			}486			catch (System.Exception exception)487			{488				_003C_003E1__state = -2;489				_003Cpwo_003E5__2 = null;490				_003C_003Et__builder.SetException(exception);491				return;492			}493			_003C_003E1__state = -2;494			_003Cpwo_003E5__2 = null;495			_003C_003Et__builder.SetResult(result3);496		}497498		[DebuggerHidden]499		private void SetStateMachine(IAsyncStateMachine stateMachine)500		{501			_003C_003Et__builder.SetStateMachine(stateMachine);502		}503	}504505	[field: CompilerGenerated]506	public string UidPwo507	{508		[CompilerGenerated]509		get;510	}511512	[field: CompilerGenerated]513	public string ObjectDisplay514	{515		[CompilerGenerated]516		get;517	}518519	[field: CompilerGenerated]520	public string Display521	{522		[CompilerGenerated]523		get;524	}525526	public bool CanExecute => true;527528	[field: CompilerGenerated]529	public bool IsActive530	{531		[CompilerGenerated]532		get;533		[CompilerGenerated]534		set;535	}536537	[field: CompilerGenerated]538	public string Reason539	{540		[CompilerGenerated]541		get;542		[CompilerGenerated]543		set;544	}545546	[field: CompilerGenerated]547	public string UidQerJustification548	{549		[CompilerGenerated]550		get;551		[CompilerGenerated]552		set;553	}554555	[field: CompilerGenerated]556	public string UidPersonForUnsubscribe557	{558		[CompilerGenerated]559		get;560		[CompilerGenerated]561		set;562	}563564	[field: CompilerGenerated]565	public int SortOrder566	{567		[CompilerGenerated]568		get;569		[CompilerGenerated]570		set;571	}572573	[field: CompilerGenerated]574	public string Id575	{576		[CompilerGenerated]577		get;578	}579580	public bool PutUnitOfWorkBefore => false;581582	public UnsubscribePwoAction(string uidPwo, string objectDisplay, string display, string id)583	{584		//IL_0013: Unknown result type (might be due to invalid IL or missing references)585		if (string.IsNullOrEmpty(uidPwo))586		{587			throw new ArgumentNullException("uidPwo");588		}589		IsActive = true;590		ObjectDisplay = objectDisplay;591		Display = display;592		Id = id;593		UidPwo = uidPwo;594	}595596	[AsyncStateMachine(typeof(_003CExecuteAsync_003Ed__28))]597	public async System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<IEntity>> ExecuteAsync(IUiActionContext context, CancellationToken ct = default(CancellationToken))598	{599		//IL_0002: Unknown result type (might be due to invalid IL or missing references)600		//IL_0007: Unknown result type (might be due to invalid IL or missing references)601		//IL_001e: Unknown result type (might be due to invalid IL or missing references)602		//IL_001f: Unknown result type (might be due to invalid IL or missing references)603		IEntity pwo = await context.Session.Source().GetAsync(new DbObjectKey("PersonWantsOrg", UidPwo), EntityLoadType.DelayedLogic, ct).ConfigureAwait(false);604		await pwo.CallMethodAsync("Unsubscribe", UidPersonForUnsubscribe, Reason ?? string.Empty, UidQerJustification, ct).ConfigureAwait(false);605		return new IEntity[1] { pwo };606	}607608	public System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<IXmlUiAction>> ToSerializableActionAsync(ISession session, CancellationToken ct = default(CancellationToken))609	{610		DiffData diffData = new DiffData();611		diffData.MethodCalls = new MethodCallData[1]612		{613			new MethodCallData614			{615				Name = "Unsubscribe",616				Parameters = new TypedValue[3]617				{618					new TypedValue(typeof(string), UidPersonForUnsubscribe),619					new TypedValue(typeof(string), Reason ?? string.Empty),620					new TypedValue(typeof(string), UidQerJustification)621				}622			}623		};624		Diff diff = new Diff(diffData);625		return System.Threading.Tasks.Task.FromResult<System.Collections.Generic.IEnumerable<IXmlUiAction>>((System.Collections.Generic.IEnumerable<IXmlUiAction>)new SerializableAction[1]626		{627			new SerializableAction(diff, new DbObjectKey("PersonWantsOrg", UidPwo))628		});629	}630631	[AsyncStateMachine(typeof(_003CFromAssignmentKeyAsync_003Ed__30))]632	public static async System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<UnsubscribePwoAction>> FromAssignmentKeyAsync(ISession session, ITranslator translator, string objectKeyAssignment, string objectDisplay, string id, string uidPersonForUnsubscribe, string reason, string uidQerJustification = null, TranslatableKey messageKey = null, CancellationToken ct = default(CancellationToken))633	{634		//IL_0002: Unknown result type (might be due to invalid IL or missing references)635		//IL_0007: Unknown result type (might be due to invalid IL or missing references)636		//IL_005b: Unknown result type (might be due to invalid IL or missing references)637		//IL_005d: Unknown result type (might be due to invalid IL or missing references)638		string whereClause = session.SqlFormatter().UidComparison("ObjectKeyAssignment", objectKeyAssignment);639		Query query = Query.From("PersonWantsOrg").SelectDisplays().Where(whereClause)640			.Where(AutoRemovalEnvironment.GetOrderStateWhereClause(session));641		IEntityCollection entityCollection = await session.Source().GetCollectionAsync(query, EntityCollectionLoadType.BulkReadOnly, ct).ConfigureAwait(false);642		List<UnsubscribePwoAction> result = new List<UnsubscribePwoAction>();643		System.Collections.Generic.IEnumerator<IEntity> enumerator = ((System.Collections.Generic.IEnumerable<IEntity>)entityCollection).GetEnumerator();644		try645		{646			while (((System.Collections.IEnumerator)enumerator).MoveNext())647			{648				IEntity current = enumerator.Current;649				string uidPwo = current.GetValue("UID_PersonWantsOrg").String;650				result.Add(new UnsubscribePwoAction(uidPwo, objectDisplay, await BuildActionDisplayAsync(current, session, translator, messageKey, ct).ConfigureAwait(false), id)651				{652					Reason = reason,653					UidPersonForUnsubscribe = uidPersonForUnsubscribe,654					UidQerJustification = uidQerJustification655				});656			}657		}658		finally659		{660			((System.IDisposable)enumerator)?.Dispose();661		}662		return (System.Collections.Generic.IEnumerable<UnsubscribePwoAction>)result;663	}664665	[AsyncStateMachine(typeof(_003CFromUidPwoAsync_003Ed__31))]666	public static async System.Threading.Tasks.Task<UnsubscribePwoAction> FromUidPwoAsync(ISession session, ITranslator translator, string uidPwo, string id, string uidPersonForUnsubscribe, string reason, string uidQerJustification = null, TranslatableKey messageKey = null, CancellationToken ct = default(CancellationToken))667	{668		//IL_0002: Unknown result type (might be due to invalid IL or missing references)669		//IL_0007: Unknown result type (might be due to invalid IL or missing references)670		//IL_0052: Unknown result type (might be due to invalid IL or missing references)671		//IL_0054: Unknown result type (might be due to invalid IL or missing references)672		DbObjectKey key = new DbObjectKey("PersonWantsOrg", uidPwo);673		IEntity pwo = await session.Source().GetAsync(key, EntityLoadType.ReadOnly, ct).ConfigureAwait(false);674		string display = await BuildActionDisplayAsync(pwo, session, translator, messageKey, ct).ConfigureAwait(false);675		return new UnsubscribePwoAction(uidPwo, pwo.Display, display, id)676		{677			Reason = reason,678			UidPersonForUnsubscribe = uidPersonForUnsubscribe,679			UidQerJustification = uidQerJustification680		};681	}682683	[AsyncStateMachine(typeof(_003CBuildActionDisplayAsync_003Ed__32))]684	private static async System.Threading.Tasks.Task<string> BuildActionDisplayAsync(IEntity pwo, ISession session, ITranslator translator, TranslatableKey messageKey = null, CancellationToken ct = default(CancellationToken))685	{686		//IL_0002: Unknown result type (might be due to invalid IL or missing references)687		//IL_0007: Unknown result type (might be due to invalid IL or missing references)688		//IL_002e: Unknown result type (might be due to invalid IL or missing references)689		//IL_0030: Unknown result type (might be due to invalid IL or missing references)690		List<string> obj = new List<string>();691		obj.Add(translator.TranslateControlText(messageKey ?? AdditionalKeys.UnsubscribingRequest));692		List<string> messages = obj;693		System.DateTime date = pwo.GetValue("ValidUntil").Date;694		if (date > System.DateTime.UtcNow)695		{696			messages.Add(string.Format(translator.TranslateControlText(TranslatableKeys.AssignmentRequestValidUntil), (object)DbVal.FromUniversalTime(date, session.TimeZone).ToShortDateString()));697		}698		DbVal value = pwo.GetValue("UID_PersonWantsOrg");699		if (await session.Source().ExistsAsync("Delegation", session.SqlFormatter().UidComparison("UID_PersonWantsOrg", value), ct).ConfigureAwait(false))700		{701			messages.Add(string.Format(translator.TranslateControlText(TranslatableKeys.AssignmentRequestDelegatedFrom), (object)pwo.GetValue("DisplayPersonInserted")));702		}703		return string.Join(". ", (System.Collections.Generic.IEnumerable<string>)((System.Collections.Generic.IReadOnlyList<string>)messages).Select<string, string>((string m) => m.TrimEnd('.')));704	}705706	public System.Threading.Tasks.Task CleanUpAsync(IUiActionContext context, ActionState state, CancellationToken ct = default(CancellationToken))707	{708		return NullTask.Instance;709	}710}711