[英]EF 4.3.1 code first table index mapping or creation
I've been searchin around a lot for a way to create, or configure a specific index on a table from EF code first, but really can't find a thing. 我一直在寻找很多方法来首先从EF代码创建或配置表上的特定索引,但实际上找不到任何东西。 mapping fluent Api doesn't seem to expose any means to do this. 映射流畅的Api似乎并没有公开任何方法。 What am I missing? 我想念什么?
You can add index creation either to custom database intitializer as mentioned in linked answer or you can use code based migrations . 您可以将索引创建添加到链接的答案中提到的自定义数据库初始化器中,也可以使用基于代码的迁移 。 Migrations provide support for index creation . 迁移为索引创建提供了支持 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.