简体   繁体   中英

How to set a field as indexed in Entity Framework Model-First designer

This has been asked a lot in the past, and I know that there was no direct support for setting a field as indexed in the EDMX designer, but since Visual Studio 2012 is out and Entity Framework 5 is released, it may now be supporting editing indexing options in the designer (no reason for it not to support it anyway), I've looked at the properties of fields and all I can find is to set a field as entity key but it doesn't solve my issue (I already have an entity key, I just want to create indexes on some other fields for performance reasons).

How do I set a field as an indexed column in the EDMX designer? (I know how to do it after via SQL queries, but I need a more modular approach as I'll be editing the database and recreating it and I will most likely forget to add an index every time by an SQL query).

Thanks, Can.

Unfortunately things have not changed in VS2012 in this area. I would encourage you to open a work item on EF6 codeplex site

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM