Common.Customizer/VI.Common.Customizer/DialogDatabase.cs
Decompiler Source FileCommon.Customizer.DialogDatabaseSandbox DB
Interpretation
- Decompiled source file. Use method/event registrations and call-site extraction to connect back to DialogMethod, QBMEvent, and API layers.
Relations
- Method registration: ExecuteTemplates at line 700
Typed Edges
- No typed edges extracted for this source.
References
- No direct source references extracted.
Referenced By
- No direct source references extracted.
C# source-derived context
Generated by pattern extraction from the decompiled C# source and decompile index. This is factual source evidence, not inferred behavior.
reads entity values references DB/Dialog objects
Summary: classes DialogDatabase, _003C_003Ec__DisplayClass7_0; methods _003C_CheckDialogCultureDefault_003Eb__0, MoveNext, SetStateMachine, OnSavingAsync, _CheckAuthentifierAsync, _CheckConnectionStringAsync; references DialogAuthentifier, DialogDatabase, QBMCulture; markers reads entity values, references DB/Dialog objects
Classes
DialogDatabase _003C_003Ec__DisplayClass7_0Methods
DB/Dialog object references
OIM key/entity markers
UID_DialogCulture UID_DialogAuthentifier UID_DialogCultureDefault UID_DatabaseAPI/entity calls
GetValueAsync ExistsAsync SqlFormatter Source From IsDeletedRegistrations / handlers
None extracted.
Complete Source
1using System;2using System.Data.Common;3using System.Diagnostics;4using System.Net;5using System.Runtime.CompilerServices;6using System.Runtime.InteropServices;7using System.Threading;8using System.Threading.Tasks;9using VI.Base;10using VI.Base.Encryption;11using VI.DB;12using VI.DB.Entities;1314namespace VI.Common.Customizer;1516public class DialogDatabase : CommonLogicBase17{18 [CompilerGenerated]19 private sealed class _003C_003Ec__DisplayClass7_020 {21 public string uidCultureDefault;2223 internal ExpressionClause _003C_CheckDialogCultureDefault_003Eb__0(IExpressionContext c)24 {25 return c.Column("UID_DialogCulture") == uidCultureDefault;26 }27 }2829 [StructLayout((LayoutKind)3)]30 [CompilerGenerated]31 private struct _003COnSavingAsync_003Ed__3 : IAsyncStateMachine32 {33 public int _003C_003E1__state;3435 public AsyncTaskMethodBuilder<Diff> _003C_003Et__builder;3637 public DialogDatabase _003C_003E4__this;3839 public IEntity entity;4041 public LogicReadWriteParameters parameters;4243 public CancellationToken cancellationToken;4445 private Diff _003Cret_003E5__2;4647 private ConfiguredTaskAwaiter<Diff> _003C_003Eu__1;4849 private ConfiguredTaskAwaiter _003C_003Eu__2;5051 private void MoveNext()52 {53 //IL_007b: Unknown result type (might be due to invalid IL or missing references)54 //IL_0080: Unknown result type (might be due to invalid IL or missing references)55 //IL_0088: Unknown result type (might be due to invalid IL or missing references)56 //IL_0101: Unknown result type (might be due to invalid IL or missing references)57 //IL_0106: Unknown result type (might be due to invalid IL or missing references)58 //IL_010e: Unknown result type (might be due to invalid IL or missing references)59 //IL_017f: Unknown result type (might be due to invalid IL or missing references)60 //IL_0184: Unknown result type (might be due to invalid IL or missing references)61 //IL_018c: Unknown result type (might be due to invalid IL or missing references)62 //IL_01fa: Unknown result type (might be due to invalid IL or missing references)63 //IL_01ff: Unknown result type (might be due to invalid IL or missing references)64 //IL_0207: Unknown result type (might be due to invalid IL or missing references)65 //IL_0032: Unknown result type (might be due to invalid IL or missing references)66 //IL_003d: Unknown result type (might be due to invalid IL or missing references)67 //IL_0042: Unknown result type (might be due to invalid IL or missing references)68 //IL_0046: Unknown result type (might be due to invalid IL or missing references)69 //IL_004b: Unknown result type (might be due to invalid IL or missing references)70 //IL_00b8: Unknown result type (might be due to invalid IL or missing references)71 //IL_00c3: Unknown result type (might be due to invalid IL or missing references)72 //IL_00c8: Unknown result type (might be due to invalid IL or missing references)73 //IL_00cc: Unknown result type (might be due to invalid IL or missing references)74 //IL_00d1: Unknown result type (might be due to invalid IL or missing references)75 //IL_0136: Unknown result type (might be due to invalid IL or missing references)76 //IL_0141: Unknown result type (might be due to invalid IL or missing references)77 //IL_0146: Unknown result type (might be due to invalid IL or missing references)78 //IL_014a: Unknown result type (might be due to invalid IL or missing references)79 //IL_014f: Unknown result type (might be due to invalid IL or missing references)80 //IL_01b4: Unknown result type (might be due to invalid IL or missing references)81 //IL_01bf: Unknown result type (might be due to invalid IL or missing references)82 //IL_01c4: Unknown result type (might be due to invalid IL or missing references)83 //IL_01c8: Unknown result type (might be due to invalid IL or missing references)84 //IL_01cd: Unknown result type (might be due to invalid IL or missing references)85 //IL_0060: Unknown result type (might be due to invalid IL or missing references)86 //IL_0062: Unknown result type (might be due to invalid IL or missing references)87 //IL_00e6: Unknown result type (might be due to invalid IL or missing references)88 //IL_00e8: Unknown result type (might be due to invalid IL or missing references)89 //IL_0164: Unknown result type (might be due to invalid IL or missing references)90 //IL_0166: Unknown result type (might be due to invalid IL or missing references)91 //IL_01e2: Unknown result type (might be due to invalid IL or missing references)92 //IL_01e4: Unknown result type (might be due to invalid IL or missing references)93 int num = _003C_003E1__state;94 DialogDatabase dialogDatabase = _003C_003E4__this;95 Diff result2;96 try97 {98 ConfiguredTaskAwaiter<Diff> val2;99 ConfiguredTaskAwaiter val;100 ConfiguredTaskAwaitable val3;101 Diff result;102 switch (num)103 {104 default:105 val2 = ((EntityLogicBase)dialogDatabase).OnSavingAsync(entity, parameters, cancellationToken).ConfigureAwait(false).GetAwaiter();106 if (!val2.IsCompleted)107 {108 num = (_003C_003E1__state = 0);109 _003C_003Eu__1 = val2;110 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<Diff>, _003COnSavingAsync_003Ed__3>(ref val2, ref this);111 return;112 }113 goto IL_0097;114 case 0:115 val2 = _003C_003Eu__1;116 _003C_003Eu__1 = default(ConfiguredTaskAwaiter<Diff>);117 num = (_003C_003E1__state = -1);118 goto IL_0097;119 case 1:120 val = _003C_003Eu__2;121 _003C_003Eu__2 = default(ConfiguredTaskAwaiter);122 num = (_003C_003E1__state = -1);123 goto IL_011d;124 case 2:125 val = _003C_003Eu__2;126 _003C_003Eu__2 = default(ConfiguredTaskAwaiter);127 num = (_003C_003E1__state = -1);128 goto IL_019b;129 case 3:130 {131 val = _003C_003Eu__2;132 _003C_003Eu__2 = default(ConfiguredTaskAwaiter);133 num = (_003C_003E1__state = -1);134 break;135 }136 IL_011d:137 ((ConfiguredTaskAwaiter)(ref val)).GetResult();138 val3 = _CheckAuthentifierAsync(entity, parameters.Session, cancellationToken).ConfigureAwait(false);139 val = ((ConfiguredTaskAwaitable)(ref val3)).GetAwaiter();140 if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)141 {142 num = (_003C_003E1__state = 2);143 _003C_003Eu__2 = val;144 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnSavingAsync_003Ed__3>(ref val, ref this);145 return;146 }147 goto IL_019b;148 IL_0097:149 result = val2.GetResult();150 _003Cret_003E5__2 = result;151 val3 = _CheckIsMainDatabaseAsync(entity, parameters.Session, cancellationToken).ConfigureAwait(false);152 val = ((ConfiguredTaskAwaitable)(ref val3)).GetAwaiter();153 if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)154 {155 num = (_003C_003E1__state = 1);156 _003C_003Eu__2 = val;157 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnSavingAsync_003Ed__3>(ref val, ref this);158 return;159 }160 goto IL_011d;161 IL_019b:162 ((ConfiguredTaskAwaiter)(ref val)).GetResult();163 val3 = _CheckConnectionStringAsync(parameters.Session, entity, cancellationToken).ConfigureAwait(false);164 val = ((ConfiguredTaskAwaitable)(ref val3)).GetAwaiter();165 if (!((ConfiguredTaskAwaiter)(ref val)).IsCompleted)166 {167 num = (_003C_003E1__state = 3);168 _003C_003Eu__2 = val;169 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter, _003COnSavingAsync_003Ed__3>(ref val, ref this);170 return;171 }172 break;173 }174 ((ConfiguredTaskAwaiter)(ref val)).GetResult();175 result2 = _003Cret_003E5__2;176 }177 catch (System.Exception exception)178 {179 _003C_003E1__state = -2;180 _003Cret_003E5__2 = null;181 _003C_003Et__builder.SetException(exception);182 return;183 }184 _003C_003E1__state = -2;185 _003Cret_003E5__2 = null;186 _003C_003Et__builder.SetResult(result2);187 }188189 [DebuggerHidden]190 private void SetStateMachine(IAsyncStateMachine stateMachine)191 {192 _003C_003Et__builder.SetStateMachine(stateMachine);193 }194 }195196 [StructLayout((LayoutKind)3)]197 [CompilerGenerated]198 private struct _003C_CheckAuthentifierAsync_003Ed__4 : IAsyncStateMachine199 {200 public int _003C_003E1__state;201202 public AsyncTaskMethodBuilder _003C_003Et__builder;203204 public IEntity entity;205206 public CancellationToken cancellationToken;207208 public ISession session;209210 private ConfiguredValueTaskAwaiter<string> _003C_003Eu__1;211212 private ConfiguredTaskAwaiter<bool> _003C_003Eu__2;213214 private void MoveNext()215 {216 //IL_006a: Unknown result type (might be due to invalid IL or missing references)217 //IL_006f: Unknown result type (might be due to invalid IL or missing references)218 //IL_0077: Unknown result type (might be due to invalid IL or missing references)219 //IL_0131: Unknown result type (might be due to invalid IL or missing references)220 //IL_0136: Unknown result type (might be due to invalid IL or missing references)221 //IL_013e: Unknown result type (might be due to invalid IL or missing references)222 //IL_001d: Unknown result type (might be due to invalid IL or missing references)223 //IL_002c: Unknown result type (might be due to invalid IL or missing references)224 //IL_0031: Unknown result type (might be due to invalid IL or missing references)225 //IL_0035: Unknown result type (might be due to invalid IL or missing references)226 //IL_003a: Unknown result type (might be due to invalid IL or missing references)227 //IL_00eb: Unknown result type (might be due to invalid IL or missing references)228 //IL_00f6: Unknown result type (might be due to invalid IL or missing references)229 //IL_00fb: Unknown result type (might be due to invalid IL or missing references)230 //IL_00ff: Unknown result type (might be due to invalid IL or missing references)231 //IL_0104: Unknown result type (might be due to invalid IL or missing references)232 //IL_004f: Unknown result type (might be due to invalid IL or missing references)233 //IL_0051: Unknown result type (might be due to invalid IL or missing references)234 //IL_0119: Unknown result type (might be due to invalid IL or missing references)235 //IL_011b: Unknown result type (might be due to invalid IL or missing references)236 int num = _003C_003E1__state;237 try238 {239 ConfiguredTaskAwaiter<bool> val;240 ConfiguredValueTaskAwaiter<string> val2;241 if (num != 0)242 {243 if (num == 1)244 {245 val = _003C_003Eu__2;246 _003C_003Eu__2 = default(ConfiguredTaskAwaiter<bool>);247 num = (_003C_003E1__state = -1);248 goto IL_014d;249 }250 val2 = entity.GetValueAsync<string>("UID_DialogAuthentifier", cancellationToken).ConfigureAwait(false).GetAwaiter();251 if (!val2.IsCompleted)252 {253 num = (_003C_003E1__state = 0);254 _003C_003Eu__1 = val2;255 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<string>, _003C_CheckAuthentifierAsync_003Ed__4>(ref val2, ref this);256 return;257 }258 }259 else260 {261 val2 = _003C_003Eu__1;262 _003C_003Eu__1 = default(ConfiguredValueTaskAwaiter<string>);263 num = (_003C_003E1__state = -1);264 }265 string result = val2.GetResult();266 if (!string.IsNullOrEmpty(result))267 {268 ISqlFormatter sqlFormatter = session.SqlFormatter();269 string whereclause = sqlFormatter.AndRelation(sqlFormatter.UidComparison("UID_DialogAuthentifier", result), sqlFormatter.Comparison("IsEnabled", true, ValType.Bool));270 val = session.Source().ExistsAsync("DialogAuthentifier", whereclause, cancellationToken).ConfigureAwait(false)271 .GetAwaiter();272 if (!val.IsCompleted)273 {274 num = (_003C_003E1__state = 1);275 _003C_003Eu__2 = val;276 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<bool>, _003C_CheckAuthentifierAsync_003Ed__4>(ref val, ref this);277 return;278 }279 goto IL_014d;280 }281 goto end_IL_0007;282 IL_014d:283 if (!val.GetResult())284 {285 throw new ViException(882129, ExceptionRelevance.EndUser);286 }287 end_IL_0007:;288 }289 catch (System.Exception exception)290 {291 _003C_003E1__state = -2;292 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);293 return;294 }295 _003C_003E1__state = -2;296 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();297 }298299 [DebuggerHidden]300 private void SetStateMachine(IAsyncStateMachine stateMachine)301 {302 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);303 }304 }305306 [StructLayout((LayoutKind)3)]307 [CompilerGenerated]308 private struct _003C_CheckConnectionStringAsync_003Ed__5 : IAsyncStateMachine309 {310 public int _003C_003E1__state;311312 public AsyncTaskMethodBuilder _003C_003Et__builder;313314 public IEntity entity;315316 public CancellationToken cancellationToken;317318 public ISession session;319320 private ConfiguredValueTaskAwaiter<string> _003C_003Eu__1;321322 private void MoveNext()323 {324 //IL_006a: Unknown result type (might be due to invalid IL or missing references)325 //IL_006f: Unknown result type (might be due to invalid IL or missing references)326 //IL_0077: Unknown result type (might be due to invalid IL or missing references)327 //IL_0103: Unknown result type (might be due to invalid IL or missing references)328 //IL_0108: Unknown result type (might be due to invalid IL or missing references)329 //IL_0110: Unknown result type (might be due to invalid IL or missing references)330 //IL_001d: Unknown result type (might be due to invalid IL or missing references)331 //IL_002c: Unknown result type (might be due to invalid IL or missing references)332 //IL_0031: Unknown result type (might be due to invalid IL or missing references)333 //IL_0035: Unknown result type (might be due to invalid IL or missing references)334 //IL_003a: Unknown result type (might be due to invalid IL or missing references)335 //IL_00b6: Unknown result type (might be due to invalid IL or missing references)336 //IL_00c5: Unknown result type (might be due to invalid IL or missing references)337 //IL_00ca: Unknown result type (might be due to invalid IL or missing references)338 //IL_00ce: Unknown result type (might be due to invalid IL or missing references)339 //IL_00d3: Unknown result type (might be due to invalid IL or missing references)340 //IL_004f: Unknown result type (might be due to invalid IL or missing references)341 //IL_0051: Unknown result type (might be due to invalid IL or missing references)342 //IL_00e8: Unknown result type (might be due to invalid IL or missing references)343 //IL_00ea: Unknown result type (might be due to invalid IL or missing references)344 //IL_0140: Unknown result type (might be due to invalid IL or missing references)345 //IL_0145: Unknown result type (might be due to invalid IL or missing references)346 //IL_014d: Expected O, but got Unknown347 int num = _003C_003E1__state;348 try349 {350 ConfiguredValueTaskAwaiter<string> val;351 if (num != 0)352 {353 if (num == 1)354 {355 val = _003C_003Eu__1;356 _003C_003Eu__1 = default(ConfiguredValueTaskAwaiter<string>);357 num = (_003C_003E1__state = -1);358 goto IL_011f;359 }360 val = entity.GetValueAsync<string>("ConnectionProvider", cancellationToken).ConfigureAwait(false).GetAwaiter();361 if (!val.IsCompleted)362 {363 num = (_003C_003E1__state = 0);364 _003C_003Eu__1 = val;365 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<string>, _003C_CheckConnectionStringAsync_003Ed__5>(ref val, ref this);366 return;367 }368 }369 else370 {371 val = _003C_003Eu__1;372 _003C_003Eu__1 = default(ConfiguredValueTaskAwaiter<string>);373 num = (_003C_003E1__state = -1);374 }375 string result = val.GetResult();376 if (string.IsNullOrEmpty(result) || result.IndexOf("ViSqlFactory", (StringComparison)5) >= 0)377 {378 val = entity.GetValueAsync<string>("ConnectionString", cancellationToken).ConfigureAwait(false).GetAwaiter();379 if (!val.IsCompleted)380 {381 num = (_003C_003E1__state = 1);382 _003C_003Eu__1 = val;383 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<string>, _003C_CheckConnectionStringAsync_003Ed__5>(ref val, ref this);384 return;385 }386 goto IL_011f;387 }388 goto end_IL_0007;389 IL_011f:390 string result2 = val.GetResult();391 if (!session.Resolve<IEncryption>().IsEncrypted(result2))392 {393 DbConnectionStringBuilder val2;394 try395 {396 val2 = new DbConnectionStringBuilder397 {398 ConnectionString = result2399 };400 }401 catch402 {403 goto end_IL_0007;404 }405 if (val2.ContainsKey("Data Source"))406 {407 string text = DbVal.ConvertTo<string>(val2["Data Source"]);408 string text2 = text.ToLowerInvariant();409 if (text2 == "localhost" || text2 == ".")410 {411 throw new ViException(882159, ExceptionRelevance.EndUser, text);412 }413 IPAddress val3 = default(IPAddress);414 if (IPAddress.TryParse(text, ref val3) && IPAddress.IsLoopback(val3))415 {416 throw new ViException(882159, ExceptionRelevance.EndUser, text);417 }418 }419 }420 end_IL_0007:;421 }422 catch (System.Exception exception)423 {424 _003C_003E1__state = -2;425 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);426 return;427 }428 _003C_003E1__state = -2;429 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();430 }431432 [DebuggerHidden]433 private void SetStateMachine(IAsyncStateMachine stateMachine)434 {435 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);436 }437 }438439 [StructLayout((LayoutKind)3)]440 [CompilerGenerated]441 private struct _003C_CheckDialogCultureDefault_003Ed__7 : IAsyncStateMachine442 {443 public int _003C_003E1__state;444445 public AsyncTaskMethodBuilder<bool> _003C_003Et__builder;446447 public string uidCultureDefault;448449 public ISession session;450451 public CancellationToken ct;452453 private ConfiguredTaskAwaiter<string> _003C_003Eu__1;454455 private void MoveNext()456 {457 //IL_00b5: Unknown result type (might be due to invalid IL or missing references)458 //IL_00ba: Unknown result type (might be due to invalid IL or missing references)459 //IL_00c2: Unknown result type (might be due to invalid IL or missing references)460 //IL_006f: Unknown result type (might be due to invalid IL or missing references)461 //IL_007a: Unknown result type (might be due to invalid IL or missing references)462 //IL_007f: Unknown result type (might be due to invalid IL or missing references)463 //IL_0083: Unknown result type (might be due to invalid IL or missing references)464 //IL_0088: Unknown result type (might be due to invalid IL or missing references)465 //IL_009d: Unknown result type (might be due to invalid IL or missing references)466 //IL_009f: Unknown result type (might be due to invalid IL or missing references)467 int num = _003C_003E1__state;468 bool result;469 try470 {471 ConfiguredTaskAwaiter<string> val;472 if (num == 0)473 {474 val = _003C_003Eu__1;475 _003C_003Eu__1 = default(ConfiguredTaskAwaiter<string>);476 num = (_003C_003E1__state = -1);477 goto IL_00d1;478 }479 _003C_003Ec__DisplayClass7_0 CS_0024_003C_003E8__locals2 = new _003C_003Ec__DisplayClass7_0480 {481 uidCultureDefault = uidCultureDefault482 };483 if (!string.IsNullOrEmpty(CS_0024_003C_003E8__locals2.uidCultureDefault))484 {485 Query query = (from c in Query.From("QBMCulture")486 where c.Column("UID_DialogCulture") == CS_0024_003C_003E8__locals2.uidCultureDefault487 select c).Select("UID_DialogCultureDefault");488 val = session.Source().GetSingleValueAsync<string>(query, ct).ConfigureAwait(false)489 .GetAwaiter();490 if (!val.IsCompleted)491 {492 num = (_003C_003E1__state = 0);493 _003C_003Eu__1 = val;494 _003C_003Et__builder.AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<string>, _003C_CheckDialogCultureDefault_003Ed__7>(ref val, ref this);495 return;496 }497 goto IL_00d1;498 }499 result = true;500 goto end_IL_0007;501 IL_00d1:502 if (!string.IsNullOrEmpty(val.GetResult()))503 {504 throw new ViException(882543, ExceptionRelevance.EndUser);505 }506 result = true;507 end_IL_0007:;508 }509 catch (System.Exception exception)510 {511 _003C_003E1__state = -2;512 _003C_003Et__builder.SetException(exception);513 return;514 }515 _003C_003E1__state = -2;516 _003C_003Et__builder.SetResult(result);517 }518519 [DebuggerHidden]520 private void SetStateMachine(IAsyncStateMachine stateMachine)521 {522 _003C_003Et__builder.SetStateMachine(stateMachine);523 }524 }525526 [StructLayout((LayoutKind)3)]527 [CompilerGenerated]528 private struct _003C_CheckIsMainDatabaseAsync_003Ed__6 : IAsyncStateMachine529 {530 public int _003C_003E1__state;531532 public AsyncTaskMethodBuilder _003C_003Et__builder;533534 public IEntity entity;535536 public CancellationToken cancellationToken;537538 public ISession session;539540 private ConfiguredValueTaskAwaiter<bool> _003C_003Eu__1;541542 private ISqlFormatter _003C_003E7__wrap1;543544 private string _003C_003E7__wrap2;545546 private ISqlFormatter _003C_003E7__wrap3;547548 private ConfiguredValueTaskAwaiter<string> _003C_003Eu__2;549550 private ConfiguredTaskAwaiter<bool> _003C_003Eu__3;551552 private void MoveNext()553 {554 //IL_0070: Unknown result type (might be due to invalid IL or missing references)555 //IL_0075: Unknown result type (might be due to invalid IL or missing references)556 //IL_007c: Unknown result type (might be due to invalid IL or missing references)557 //IL_013d: Unknown result type (might be due to invalid IL or missing references)558 //IL_0142: Unknown result type (might be due to invalid IL or missing references)559 //IL_014a: Unknown result type (might be due to invalid IL or missing references)560 //IL_0202: Unknown result type (might be due to invalid IL or missing references)561 //IL_0207: Unknown result type (might be due to invalid IL or missing references)562 //IL_020f: Unknown result type (might be due to invalid IL or missing references)563 //IL_0025: Unknown result type (might be due to invalid IL or missing references)564 //IL_0034: Unknown result type (might be due to invalid IL or missing references)565 //IL_0039: Unknown result type (might be due to invalid IL or missing references)566 //IL_003d: Unknown result type (might be due to invalid IL or missing references)567 //IL_0042: Unknown result type (might be due to invalid IL or missing references)568 //IL_01bc: Unknown result type (might be due to invalid IL or missing references)569 //IL_01c7: Unknown result type (might be due to invalid IL or missing references)570 //IL_01cc: Unknown result type (might be due to invalid IL or missing references)571 //IL_01d0: Unknown result type (might be due to invalid IL or missing references)572 //IL_01d5: Unknown result type (might be due to invalid IL or missing references)573 //IL_0056: Unknown result type (might be due to invalid IL or missing references)574 //IL_0057: Unknown result type (might be due to invalid IL or missing references)575 //IL_01ea: Unknown result type (might be due to invalid IL or missing references)576 //IL_01ec: Unknown result type (might be due to invalid IL or missing references)577 //IL_00f0: Unknown result type (might be due to invalid IL or missing references)578 //IL_00ff: Unknown result type (might be due to invalid IL or missing references)579 //IL_0104: Unknown result type (might be due to invalid IL or missing references)580 //IL_0108: Unknown result type (might be due to invalid IL or missing references)581 //IL_010d: Unknown result type (might be due to invalid IL or missing references)582 //IL_0122: Unknown result type (might be due to invalid IL or missing references)583 //IL_0124: Unknown result type (might be due to invalid IL or missing references)584 int num = _003C_003E1__state;585 try586 {587 ConfiguredValueTaskAwaiter<bool> val3;588 ConfiguredValueTaskAwaiter<string> val2;589 ConfiguredTaskAwaiter<bool> val;590 string result;591 string whereclause;592 switch (num)593 {594 default:595 val3 = entity.GetValueAsync<bool>("IsMainDatabase", cancellationToken).ConfigureAwait(false).GetAwaiter();596 if (!val3.IsCompleted)597 {598 num = (_003C_003E1__state = 0);599 _003C_003Eu__1 = val3;600 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<bool>, _003C_CheckIsMainDatabaseAsync_003Ed__6>(ref val3, ref this);601 return;602 }603 goto IL_008b;604 case 0:605 val3 = _003C_003Eu__1;606 _003C_003Eu__1 = default(ConfiguredValueTaskAwaiter<bool>);607 num = (_003C_003E1__state = -1);608 goto IL_008b;609 case 1:610 val2 = _003C_003Eu__2;611 _003C_003Eu__2 = default(ConfiguredValueTaskAwaiter<string>);612 num = (_003C_003E1__state = -1);613 goto IL_0159;614 case 2:615 {616 val = _003C_003Eu__3;617 _003C_003Eu__3 = default(ConfiguredTaskAwaiter<bool>);618 num = (_003C_003E1__state = -1);619 break;620 }621 IL_0159:622 result = val2.GetResult();623 whereclause = _003C_003E7__wrap1.AndRelation(_003C_003E7__wrap2, _003C_003E7__wrap3.Comparison("UID_Database", result, ValType.String, CompareOperator.NotEqual, FormatterOptions.None));624 _003C_003E7__wrap1 = null;625 _003C_003E7__wrap2 = null;626 _003C_003E7__wrap3 = null;627 val = session.Source().ExistsAsync("DialogDatabase", whereclause, cancellationToken).ConfigureAwait(false)628 .GetAwaiter();629 if (!val.IsCompleted)630 {631 num = (_003C_003E1__state = 2);632 _003C_003Eu__3 = val;633 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredTaskAwaiter<bool>, _003C_CheckIsMainDatabaseAsync_003Ed__6>(ref val, ref this);634 return;635 }636 break;637 IL_008b:638 if (val3.GetResult())639 {640 if (entity.IsDeleted())641 {642 throw new ViException(882124, ExceptionRelevance.EndUser);643 }644 ISqlFormatter sqlFormatter = (_003C_003E7__wrap1 = session.SqlFormatter());645 _003C_003E7__wrap2 = sqlFormatter.Comparison("IsMainDatabase", true, ValType.Bool);646 _003C_003E7__wrap3 = sqlFormatter;647 val2 = entity.GetValueAsync<string>("UID_Database", cancellationToken).ConfigureAwait(false).GetAwaiter();648 if (!val2.IsCompleted)649 {650 num = (_003C_003E1__state = 1);651 _003C_003Eu__2 = val2;652 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).AwaitUnsafeOnCompleted<ConfiguredValueTaskAwaiter<string>, _003C_CheckIsMainDatabaseAsync_003Ed__6>(ref val2, ref this);653 return;654 }655 goto IL_0159;656 }657 goto end_IL_0007;658 }659 if (val.GetResult())660 {661 throw new ViException(882123, ExceptionRelevance.EndUser);662 }663 end_IL_0007:;664 }665 catch (System.Exception exception)666 {667 _003C_003E1__state = -2;668 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetException(exception);669 return;670 }671 _003C_003E1__state = -2;672 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetResult();673 }674675 [DebuggerHidden]676 private void SetStateMachine(IAsyncStateMachine stateMachine)677 {678 ((AsyncTaskMethodBuilder)(ref _003C_003Et__builder)).SetStateMachine(stateMachine);679 }680 }681682 private static readonly string[] _mainEditColumns = new string[5] { "IsDBSchedulerDisabled", "IsJobServiceDisabled", "CustomerName", "LastMigrationDate", "UID_DialogAuthentifier" };683684 private static readonly string[] _mainMandatoryColumns = new string[1] { "CustomerName" };685686 public DialogDatabase()687 {688 CanEdit("CustomerPrefix").Default(value: false);689 string[] mainEditColumns = _mainEditColumns;690 foreach (string text in mainEditColumns)691 {692 CanEdit(text).From("IsMainDatabase").As<bool>((Func<bool, bool>)((bool m) => m)).ClearValueOnFalse();693 }694 mainEditColumns = _mainMandatoryColumns;695 foreach (string text2 in mainEditColumns)696 {697 MinLen(text2).From("IsMainDatabase").As<bool>((Func<bool, int>)((bool m) => m ? 1 : 0));698 }699 Check("UID_DialogCultureDefault").AsExpensive<string>((Func<ISession, IEntity, string, CancellationToken, System.Threading.Tasks.Task<bool>>)_CheckDialogCultureDefault);700 RegisterMethod("ExecuteTemplates").As<bool>([AsyncStateMachine(typeof(_003C_003Ec._003C_003C_002Dctor_003Eb__2_0_003Ed))] (ISession session, IEntity entity, bool updateAll, CancellationToken ct) =>701 {702 //IL_0002: Unknown result type (might be due to invalid IL or missing references)703 //IL_0007: Unknown result type (might be due to invalid IL or missing references)704 //IL_001e: Unknown result type (might be due to invalid IL or missing references)705 //IL_0020: Unknown result type (might be due to invalid IL or missing references)706 _003C_003Ec._003C_003C_002Dctor_003Eb__2_0_003Ed _003C_003C_002Dctor_003Eb__2_0_003Ed = default(_003C_003Ec._003C_003C_002Dctor_003Eb__2_0_003Ed);707 _003C_003C_002Dctor_003Eb__2_0_003Ed._003C_003Et__builder = AsyncTaskMethodBuilder.Create();708 _003C_003C_002Dctor_003Eb__2_0_003Ed.session = session;709 _003C_003C_002Dctor_003Eb__2_0_003Ed.updateAll = updateAll;710 _003C_003C_002Dctor_003Eb__2_0_003Ed.ct = ct;711 _003C_003C_002Dctor_003Eb__2_0_003Ed._003C_003E1__state = -1;712 ((AsyncTaskMethodBuilder)(ref _003C_003C_002Dctor_003Eb__2_0_003Ed._003C_003Et__builder)).Start<_003C_003Ec._003C_003C_002Dctor_003Eb__2_0_003Ed>(ref _003C_003C_002Dctor_003Eb__2_0_003Ed);713 return ((AsyncTaskMethodBuilder)(ref _003C_003C_002Dctor_003Eb__2_0_003Ed._003C_003Et__builder)).Task;714 }).Behavior(MethodBehavior.SingleObject | MethodBehavior.ChangesExternalState).Description("Method_DialogDatabase_ExecuteTemplates");715 }716717 [AsyncStateMachine(typeof(_003COnSavingAsync_003Ed__3))]718 public override async System.Threading.Tasks.Task<Diff> OnSavingAsync(IEntity entity, LogicReadWriteParameters parameters, CancellationToken cancellationToken)719 {720 //IL_0002: Unknown result type (might be due to invalid IL or missing references)721 //IL_0007: Unknown result type (might be due to invalid IL or missing references)722 //IL_0026: Unknown result type (might be due to invalid IL or missing references)723 //IL_0027: Unknown result type (might be due to invalid IL or missing references)724 Diff ret = await base.OnSavingAsync(entity, parameters, cancellationToken).ConfigureAwait(false);725 await _CheckIsMainDatabaseAsync(entity, parameters.Session, cancellationToken).ConfigureAwait(false);726 await _CheckAuthentifierAsync(entity, parameters.Session, cancellationToken).ConfigureAwait(false);727 await _CheckConnectionStringAsync(parameters.Session, entity, cancellationToken).ConfigureAwait(false);728 return ret;729 }730731 [AsyncStateMachine(typeof(_003C_CheckAuthentifierAsync_003Ed__4))]732 private static System.Threading.Tasks.Task _CheckAuthentifierAsync(IEntity entity, ISession session, CancellationToken cancellationToken)733 {734 //IL_0002: Unknown result type (might be due to invalid IL or missing references)735 //IL_0007: Unknown result type (might be due to invalid IL or missing references)736 //IL_001e: Unknown result type (might be due to invalid IL or missing references)737 //IL_001f: Unknown result type (might be due to invalid IL or missing references)738 _003C_CheckAuthentifierAsync_003Ed__4 _003C_CheckAuthentifierAsync_003Ed__ = default(_003C_CheckAuthentifierAsync_003Ed__4);739 _003C_CheckAuthentifierAsync_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();740 _003C_CheckAuthentifierAsync_003Ed__.entity = entity;741 _003C_CheckAuthentifierAsync_003Ed__.session = session;742 _003C_CheckAuthentifierAsync_003Ed__.cancellationToken = cancellationToken;743 _003C_CheckAuthentifierAsync_003Ed__._003C_003E1__state = -1;744 ((AsyncTaskMethodBuilder)(ref _003C_CheckAuthentifierAsync_003Ed__._003C_003Et__builder)).Start<_003C_CheckAuthentifierAsync_003Ed__4>(ref _003C_CheckAuthentifierAsync_003Ed__);745 return ((AsyncTaskMethodBuilder)(ref _003C_CheckAuthentifierAsync_003Ed__._003C_003Et__builder)).Task;746 }747748 [AsyncStateMachine(typeof(_003C_CheckConnectionStringAsync_003Ed__5))]749 private static System.Threading.Tasks.Task _CheckConnectionStringAsync(ISession session, IEntity entity, CancellationToken cancellationToken)750 {751 //IL_0002: Unknown result type (might be due to invalid IL or missing references)752 //IL_0007: Unknown result type (might be due to invalid IL or missing references)753 //IL_001e: Unknown result type (might be due to invalid IL or missing references)754 //IL_001f: Unknown result type (might be due to invalid IL or missing references)755 _003C_CheckConnectionStringAsync_003Ed__5 _003C_CheckConnectionStringAsync_003Ed__ = default(_003C_CheckConnectionStringAsync_003Ed__5);756 _003C_CheckConnectionStringAsync_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();757 _003C_CheckConnectionStringAsync_003Ed__.session = session;758 _003C_CheckConnectionStringAsync_003Ed__.entity = entity;759 _003C_CheckConnectionStringAsync_003Ed__.cancellationToken = cancellationToken;760 _003C_CheckConnectionStringAsync_003Ed__._003C_003E1__state = -1;761 ((AsyncTaskMethodBuilder)(ref _003C_CheckConnectionStringAsync_003Ed__._003C_003Et__builder)).Start<_003C_CheckConnectionStringAsync_003Ed__5>(ref _003C_CheckConnectionStringAsync_003Ed__);762 return ((AsyncTaskMethodBuilder)(ref _003C_CheckConnectionStringAsync_003Ed__._003C_003Et__builder)).Task;763 }764765 [AsyncStateMachine(typeof(_003C_CheckIsMainDatabaseAsync_003Ed__6))]766 private static System.Threading.Tasks.Task _CheckIsMainDatabaseAsync(IEntity entity, ISession session, CancellationToken cancellationToken)767 {768 //IL_0002: Unknown result type (might be due to invalid IL or missing references)769 //IL_0007: Unknown result type (might be due to invalid IL or missing references)770 //IL_001e: Unknown result type (might be due to invalid IL or missing references)771 //IL_001f: Unknown result type (might be due to invalid IL or missing references)772 _003C_CheckIsMainDatabaseAsync_003Ed__6 _003C_CheckIsMainDatabaseAsync_003Ed__ = default(_003C_CheckIsMainDatabaseAsync_003Ed__6);773 _003C_CheckIsMainDatabaseAsync_003Ed__._003C_003Et__builder = AsyncTaskMethodBuilder.Create();774 _003C_CheckIsMainDatabaseAsync_003Ed__.entity = entity;775 _003C_CheckIsMainDatabaseAsync_003Ed__.session = session;776 _003C_CheckIsMainDatabaseAsync_003Ed__.cancellationToken = cancellationToken;777 _003C_CheckIsMainDatabaseAsync_003Ed__._003C_003E1__state = -1;778 ((AsyncTaskMethodBuilder)(ref _003C_CheckIsMainDatabaseAsync_003Ed__._003C_003Et__builder)).Start<_003C_CheckIsMainDatabaseAsync_003Ed__6>(ref _003C_CheckIsMainDatabaseAsync_003Ed__);779 return ((AsyncTaskMethodBuilder)(ref _003C_CheckIsMainDatabaseAsync_003Ed__._003C_003Et__builder)).Task;780 }781782 [AsyncStateMachine(typeof(_003C_CheckDialogCultureDefault_003Ed__7))]783 private static async System.Threading.Tasks.Task<bool> _CheckDialogCultureDefault(ISession session, IEntity entity, string uidCultureDefault, CancellationToken ct)784 {785 //IL_0002: Unknown result type (might be due to invalid IL or missing references)786 //IL_0007: Unknown result type (might be due to invalid IL or missing references)787 //IL_001e: Unknown result type (might be due to invalid IL or missing references)788 //IL_001f: Unknown result type (might be due to invalid IL or missing references)789 if (string.IsNullOrEmpty(uidCultureDefault))790 {791 return true;792 }793 Query query = (from c in Query.From("QBMCulture")794 where c.Column("UID_DialogCulture") == uidCultureDefault795 select c).Select("UID_DialogCultureDefault");796 if (!string.IsNullOrEmpty(await session.Source().GetSingleValueAsync<string>(query, ct).ConfigureAwait(false)))797 {798 throw new ViException(882543, ExceptionRelevance.EndUser);799 }800 return true;801 }802}803