No, I want to show you one more thing.
You can see we have used the tech helper to display label.
If we go back, we have to label for display order and name.
It is using the exact same name as property.
But what if we want to display something else?
What if we want to display a space between display order?
Because inside the error message is also it displays the same format.
To do that, we have lots of data annotations that are available to help things.
Let me go back to category and stop the application.
Here we have the required data annotation.
Similarly, we have a data annotation, which is display, and then we can provide a name, whatever
we want it to display.
So let's call that display space.
Order.
Once you do that, if you save and run the application wherever it has to display the name of the property,
it will use this display attribute and whatever name we have given.
So if you go to categories create new category, you see the space between display order and if you're
right, same thing, you have that in the custom validations.
And my back, this will not change because we are adding the custom string.
So if you want that, you can always change that here.
I thought for a second it was retrieved from the property name, but that's not the case.
But you can see we can change the display attribute to a display label whenever it is being displayed.
Next, we also have custom data annotations other than required display and key.
If you go back to the Microsoft documentation, you can see all of the annotations that are available.
And that's quite a few of them.
We have one here that is range that checks if the specified number is between a range of values.
If you scroll up, we have the mainland phone number key attribute that is the one that we used and
we should have a display as well.
Let's see how we can use the page attribute when we have the display order.
Let's say you want to make sure that display order should always be between one and 100.
So here you can use the range attribute and it expects two parameters.
One is the minimum value and maximum will be 100.
Along with that, if you want to specify what message should be displayed if that condition is not true.
You can customize that if you do not like the default message software, display a custom error message
and let's see this in action.
If they try to hit the reset button, we have the invalid.
But if we enter, let's say two to two it create.
Now we see our custom error message.
So there are lots of data annotations that are available that you can check out on the documentation.
But we saw the use of display as well as range data annotation.
With that, let's continue from the next radio.