private async Task InvokeUpdateBeerByIdCommandAsync(IContext context, UpdateBeerByIdCommand command) { var triggeredEvent = new UpdateBeerByIdEvent(command.Id, command.Beer); var(IsSuccess, RowsAffected) = await actorManager.RequestAsync <BeerEventActor, (bool, int)>(triggeredEvent); context.Respond((IsSuccess, RowsAffected)); }
private async Task InvokeUpdateBeerByIdEventAsync(IContext context, UpdateBeerByIdEvent e) { var parameters = new DynamicParameters(); parameters.Add("Id", e.Id); parameters.Add("Name", e.Beer.Name); parameters.Add("Company", e.Beer.Company); parameters.Add("Style", e.Beer.Style); var(IsSuccess, RowsAffected) = await dataAccessService.ExecuteAsync("Update Beer set Name = @Name, Company = @Company, Style = @Style where Id = @Id", false, parameters); context.Respond((IsSuccess, RowsAffected)); }