Replace method argument Professor with the proper DTO = Data Transfer Object
In the dto that you will create add all the constraints that are needed for creating / updating
To work simultaneously for both methods you will need to use validation constraint Groups
The way to go is CreateGroup and UpdateGroup
You can google and search for every new subject but don't abuse it to "copy" validation rules from other projects
After replacing the argument you need to:
Replace method argument Professor with the proper DTO = Data Transfer Object In the dto that you will create add all the constraints that are needed for creating / updating To work simultaneously for both methods you will need to use validation constraint Groups The way to go is CreateGroup and UpdateGroup
You can google and search for every new subject but don't abuse it to "copy" validation rules from other projects After replacing the argument you need to: