Saturday, 16 December 2017

Data Annotations In Code First Model First and Data Base First

Data Annotation : Entity framework facilitate Data Annotation For validate Data before inserting in database client side and server side both.

for use of Data Annotation Two name space Require 

(1) System.ComponentModel.DataAnnotions 

This class hold these attributes

  1. Key
  2. Required
  3. String Length
  4. MinLength
  5. MaxLength
  6. TimeStamp
  7. ConcurrencyCheck
2) System.ComponentModel.DataAnnotation.Schema

This class hold these attributes

  1. Table
  2. Index
  3. ForeignKey
  4. NotMapped
  5. InversProperty 
  6. Column 





No comments:

Post a Comment