What is use of datatype attribute class of data annotation in mvc?

Posted by Kumarkrishna184 under ASP.NET MVC on 2/28/2017 | Points: 10 | Views : 2779 | Status : [Member] | Replies : 1
What is use of datatype attribute class in mvc?

Thanks and Regards,
Krishna Kumar


Posted by: A2H on: 2/28/2017 [Member] [MVP] Silver | Points: 25

AFAIK, we use the DataType Attribute to specify the data type associated with the data field .
For ex: If you have a column like EmailAddress in database which is mostly a sting datatype like Nvarchar or varchar. You can use EmailAddress Datatype which is more specific than the database intrinsic types.

 // Add type information.
public object EmailAddress;

Check the below link which give you more details on of usage of datatype

My Blog

Kumarkrishna184, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response