Esempio n. 1
0
        public async Task <ActionResult <UpdateDeploymentTargetResult> > Edit(
            [FromBody] UpdateDeploymentTarget updateDeploymentTarget,
            [FromServices] IMediator mediator)
        {
            if (updateDeploymentTarget is null)
            {
                return(BadRequest($"Model of type {typeof(UpdateDeploymentTarget)} is null"));
            }

            if (!updateDeploymentTarget.IsValid)
            {
                return(BadRequest($"Model of type {typeof(UpdateDeploymentTarget)} {updateDeploymentTarget} is null"));
            }
            UpdateDeploymentTargetResult updateDeploymentTargetResult = await mediator.Send(updateDeploymentTarget);

            return(updateDeploymentTargetResult);
        }
        public Task Handle(UpdateDeploymentTargetResult notification, CancellationToken cancellationToken)
        {
            InvalidateCache(notification.TargetId);

            return(Task.CompletedTask);
        }