Ejemplo n.º 1
0
        public override async Task <IResult> HandleAsync(UpdateRoleCommand command)
        {
            var aggregateRole = AggregateArgument.Mapper.Map <AggregateRole>(command);

            _roleDomainService.UpdateRole(aggregateRole);
            var result = await AggregateArgument.UnitOfWork.SaveChangeAsync().ConfigureAwait(false);

            if (result.IsSuccess)
            {
                return(Result.Ok());
            }
            else
            {
                _logger.LogError(result.Exception, "Failed to update role");
                throw result.Exception;
            }
        }