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); }
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); }