I have a DbContext that contains several DbSets of classes, with some of the classes have properties of class types that are not specifically defined in the DbContext. The migration and the Database update work smoothly. However, when I try to use the code generation tool I get the error:
Multiple custom attributes of the same type found.
First of all, I am not using any "Custom" attributes, only the following (and not on the same properties):
[ScaffoldColumn(true/false)]
[DataType(DataType.EmailAddress/PhoneNumber/Date/PostalCode/Password)]
[DisplayFormat]
[Required(ErrorMessage = "message.")]
[Phone(ErrorMessage = "A phone number is required")]
[DataType(DataType.PhoneNumber)]
I have too many lines of code to post here, but I can add some snippets if needed.
You have used DataType
twice. Choose whether you have a DataType.EmailAddress/PhoneNumber/Date/PostalCode/Password
or a DataType.PhoneNumber
.
[DataType(DataType.EmailAddress/PhoneNumber/Date/PostalCode/Password)]
[DataType(DataType.PhoneNumber)]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With