Last post Feb 07, 2017 05:37 AM by Jean Sun
Feb 06, 2017 07:40 AM|JagjitSingh|LINK
I have properties like this . I want MemberId,RegId,SSN No to be Unique . I am using Entity Framework Code First Approach. MemberId will be Primary Key.
I am using EF 5. In EF 6.1 i thibk Unique Oprion is available. I want to do in EF5.
Public String MemberId
Public String RegId
Public Int SSN No
Public String Name
Feb 07, 2017 05:37 AM|Jean Sun|LINK
Unfortunately, EF5 doesn't have such unique constraint feature.
However, I think you can write some code to check if the model data is unique before you insert it into database.