예제 #1
0
        public async override Task Execute(PermissionDeleteCommand input, User?user)
        {
            var p = await repo.FindById(input.Id) ?? throw new EntityNotFoundException();

            await spec.CheckAndThrow(p);

            await repo.Delete(p);
        }
예제 #2
0
        public async override Task Execute(PermissionUpdateCommand input, User?user)
        {
            var p = await repo.FindById(input.Id) ?? throw new EntityNotFoundException();

            p.Action = input.Action;
            p.Scope  = input.Scope;

            await spec.CheckAndThrow(p);

            await repo.Update(p);
        }