The type or namespace name ‘RequiredAttribute’ could not be found (are you missing a using directive or an assembly reference?).

The type or namespace name ‘Required’ could not be found (are you missing a using directive or an assembly reference?)

The type or namespace name ‘DisplayAttribute’ could not be found (are you missing a using directive or an assembly reference?)

The type or namespace name ‘Display’ could not be found (are you missing a using directive or an assembly reference?)

I have a solution is below:

You just add below namespace:

using System.ComponentModel.DataAnnotations;

About the Author

avatar