I am using EF5 and code first to create database. I have one string field and would like to put Index(non-unique) on it. Is it possible to create Index using Data Annotations?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
EF doesn’t have a special way to create indices, you need to revert to an old style SQL statement.
you can use the seed method to do this
as described here: Adding index to a table