components.PowerPortalsPro.Demo.Client.Customizations.Pages.GettingStarted.InterceptorsPage.title
components.PowerPortalsPro.Demo.Client.Customizations.Pages.GettingStarted.InterceptorsPage.description
components.PowerPortalsPro.Demo.Client.Customizations.Pages.GettingStarted.InterceptorsPage.overview-title
components.PowerPortalsPro.Demo.Client.Customizations.Pages.GettingStarted.InterceptorsPage.overview-description
- components.PowerPortalsPro.Demo.Client.Customizations.Pages.GettingStarted.InterceptorsPage.overview-defaults
- components.PowerPortalsPro.Demo.Client.Customizations.Pages.GettingStarted.InterceptorsPage.overview-validation
- components.PowerPortalsPro.Demo.Client.Customizations.Pages.GettingStarted.InterceptorsPage.overview-business-rules
- components.PowerPortalsPro.Demo.Client.Customizations.Pages.GettingStarted.InterceptorsPage.overview-audit
- components.PowerPortalsPro.Demo.Client.Customizations.Pages.GettingStarted.InterceptorsPage.overview-side-effects
components.PowerPortalsPro.Demo.Client.Customizations.Pages.GettingStarted.InterceptorsPage.note-label
components.PowerPortalsPro.Demo.Client.Customizations.Pages.GettingStarted.InterceptorsPage.note-server-side
components.PowerPortalsPro.Demo.Client.Customizations.Pages.GettingStarted.InterceptorsPage.getting-started-title
components.PowerPortalsPro.Demo.Client.Customizations.Pages.GettingStarted.InterceptorsPage.create-interceptor-title
components.PowerPortalsPro.Demo.Client.Customizations.Pages.GettingStarted.InterceptorsPage.create-interceptor-description
public class MyInterceptor : ITableRecordInterceptor
{
public Task OnBeforeCreateAsync(TableRecord record)
{
if (record.TableName == "contact")
{
// components.PowerPortalsPro.Demo.Client.Customizations.Pages.GettingStarted.InterceptorsPage.snippet-default-value-comment
record.Properties["statuscode"] = new ChoiceValue(1);
}
return Task.CompletedTask;
}
public Task OnAfterCreateAsync(TableRecord record) => Task.CompletedTask;
public Task OnBeforeUpdateAsync(TableRecord record) => Task.CompletedTask;
public Task OnAfterUpdateAsync(TableRecord record) => Task.CompletedTask;
public Task OnBeforeDeleteAsync(TableRecordReference record) => Task.CompletedTask;
public Task OnAfterDeleteAsync(TableRecordReference record) => Task.CompletedTask;
public Task OnBeforeAssociateAsync(TableRecord record) => Task.CompletedTask;
public Task OnAfterAssociateAsync(TableRecord record) => Task.CompletedTask;
public Task OnBeforeDisassociateAsync(TableRecord record) => Task.CompletedTask;
public Task OnAfterDisassociateAsync(TableRecord record) => Task.CompletedTask;
}
components.PowerPortalsPro.Demo.Client.Customizations.Pages.GettingStarted.InterceptorsPage.register-title
components.PowerPortalsPro.Demo.Client.Customizations.Pages.GettingStarted.InterceptorsPage.register-description
builder.Services.AddTransient<ITableRecordInterceptor, MyInterceptor>();
components.PowerPortalsPro.Demo.Client.Customizations.Pages.GettingStarted.InterceptorsPage.register-note
components.PowerPortalsPro.Demo.Client.Customizations.Pages.GettingStarted.InterceptorsPage.lifecycle-title
components.PowerPortalsPro.Demo.Client.Customizations.Pages.GettingStarted.InterceptorsPage.lifecycle-description
components.PowerPortalsPro.Demo.Client.Customizations.Pages.GettingStarted.InterceptorsPage.create-title
components.PowerPortalsPro.Demo.Client.Customizations.Pages.GettingStarted.InterceptorsPage.create-description
public async Task OnBeforeCreateAsync(TableRecord record)
{
if (record.TableName == "contact")
{
// components.PowerPortalsPro.Demo.Client.Customizations.Pages.GettingStarted.InterceptorsPage.snippet-current-user-owner-comment
var authState = await _authStateProvider.GetAuthenticationStateAsync();
var userId = authState.User.GetUserId();
if (userId != null)
{
record.Properties["ppp_owningportaluserid"] = new LookupValue
{
TableName = "contact",
Value = userId.Value
};
}
}
}
components.PowerPortalsPro.Demo.Client.Customizations.Pages.GettingStarted.InterceptorsPage.update-title
components.PowerPortalsPro.Demo.Client.Customizations.Pages.GettingStarted.InterceptorsPage.update-description
components.PowerPortalsPro.Demo.Client.Customizations.Pages.GettingStarted.InterceptorsPage.delete-title
components.PowerPortalsPro.Demo.Client.Customizations.Pages.GettingStarted.InterceptorsPage.delete-description
components.PowerPortalsPro.Demo.Client.Customizations.Pages.GettingStarted.InterceptorsPage.associate-title
components.PowerPortalsPro.Demo.Client.Customizations.Pages.GettingStarted.InterceptorsPage.associate-description
components.PowerPortalsPro.Demo.Client.Customizations.Pages.GettingStarted.InterceptorsPage.injecting-title
components.PowerPortalsPro.Demo.Client.Customizations.Pages.GettingStarted.InterceptorsPage.injecting-description
internal class SetOwnerInterceptor(
AuthenticationStateProvider authStateProvider) : ITableRecordInterceptor
{
public async Task OnBeforeCreateAsync(TableRecord record)
{
var authState = await authStateProvider.GetAuthenticationStateAsync();
// components.PowerPortalsPro.Demo.Client.Customizations.Pages.GettingStarted.InterceptorsPage.snippet-use-auth-state-comment
}
// components.PowerPortalsPro.Demo.Client.Customizations.Pages.GettingStarted.InterceptorsPage.snippet-other-methods-comment
}
components.PowerPortalsPro.Demo.Client.Customizations.Pages.GettingStarted.InterceptorsPage.api-reference-label
ITableRecordInterceptor Interface
components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.methods
components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.name | components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.parameters | components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.type | components.PowerPortalsPro.Demo.Client.Customizations.Components.Documentation.ApiDocumentation.description |
|---|---|---|---|
OnAfterAssociateAsync | TableRecord record | Task | 記録が関連付けられた後に呼び出される また多対多の関係によるレコード。関連する集約の更新に役立ちます。 ドメインイベントの発行、または参照整合性の維持。 |
OnAfterCreateAsync | TableRecord record | Task | 新しい記録が作成されるとすぐに発動されます。 ログ作成や通知などの後作成アクションにこれを使います。 または下流のワークフローをトリガーする。 |
OnAfterDeleteAsync | TableRecordReference record | Task | 記録が削除された後に発動されます。 クリーンアップ作業、監査ログ、ドメインイベントの連鎖処理に役立ちます。 |
OnAfterDisassociateAsync | TableRecord record | Task | 記録が から切り離された後に呼び出される また一つの記録。整理や集約データの更新に役立ちます。 またはフォローアッププロセスを引き起こすこともあります。 |
OnAfterUpdateAsync | TableRecord record | Task | 既存の記録が更新された後に呼び出します。 監査ログ、キャッシュ無効化、またはトリガーに有用です フォローアップのプロセス。 |
OnBeforeAssociateAsync | TableRecord record | Task | レコードが他のレコードに関連付けられる前に呼び出しられます 多対多の関係で記録する。これを使って協会を正当化し、強制する 関係ルール、または無効なリンクの防止。 |
OnBeforeCreateAsync | TableRecord record | Task | 新しい記録が作成される直前に呼び出します。 これを用いて、永続化前にレコードを検証、変異、または準備します。 |
OnBeforeDeleteAsync | TableRecordReference record | Task | レコードが削除される前に呼び出します。 これを使って削除ルールを強制したり、ソフトデリット変換を実行したりします。 または特定の条件下でのブロック削除。 |
OnBeforeDisassociateAsync | TableRecord record | Task | レコードが他のレコードから切り離される前に呼び出しられます 記録。これを使い、解離を正当化し、強制する 制約、または必要な関係のブロック除去。 |
OnBeforeUpdateAsync | TableRecord record | Task | 既存のレコードが更新される前に呼び出しられます。 これを使って変更の検証、ビジネスルールの強制、または修正に使います 更新前のレコードが永続化されます。 |
OnAfterAssociateAsyncOnAfterCreateAsyncOnAfterDeleteAsyncOnAfterDisassociateAsyncOnAfterUpdateAsyncOnBeforeAssociateAsyncOnBeforeCreateAsyncOnBeforeDeleteAsyncOnBeforeDisassociateAsyncOnBeforeUpdateAsync