AfterEntityUpdate
When to Use
Sample API Implementation
using Bloqs.App.Engine.Commands;
using Bloqs.App.Engine.Commands.After;
using Templates.SampleApp.Models.Data;
namespace Templates.SampleApp.Api.Commands.Activities;
[EntityCommandHandler<Activity>]
public class AfterActivityUpdate
: ICommandHandler<AfterEntityUpdateCommand, AfterEntityUpdateCommandResult>
{
public Task<AfterEntityUpdateCommandResult> HandleAsync(
AfterEntityUpdateCommand command,
CancellationToken cancellationToken = default
)
{
var activity = (Activity)command.DataEntities.First();
Console.WriteLine($"{AppConstants.App.Name} [API]: Activity updated: " + activity.Name);
// Example: trigger some post-update logic
// NotifyUsers(activity);
return Task.FromResult(AfterEntityUpdateCommandResult.CreateSuccess());
}
}Sample UI Implementation (Blazor WASM)
Notes
Last updated