Entity Framework 6.0 Tutorials(10):Index Attribute
Index Attribute:
Entity Framework 6 provides Index attribute to create Index on a particular column in the database as shown below:
class Student
{
public Student()
{
} public int Student_ID { get; set; }
public string StudentName { get; set; } [Index]
public int RegistrationNumber { get; set; }
}
By default, Index name will be IX_{property name}. However, you can also change the Index name.
You can also make it a Clustered index by specifying IsClustered = true and a unique index by specifying IsUnique=true.
[Index( "INDEX_REGNUM", IsClustered=true, IsUnique=true )]
public int RegistrationNumber { get; set; }
Download Code-First sample project for Index attribute demo.
Entity Framework 6.0 Tutorials(10):Index Attribute的更多相关文章
- Entity Framework 6.0 Tutorials(1):Introduction
以下系统文章为EF6.0知识的介绍,本章是第一篇 原文地址:http://www.entityframeworktutorial.net/entityframework6/introduction.a ...
- Entity Framework 6.0 Tutorials(4):Database Command Logging
Database Command Logging: In this section, you will learn how to log commands & queries sent to ...
- Entity Framework 6.0 Tutorials(11):Download Sample Project
Download Sample Project: Download a sample project for Entity Framework 6 Database-First model below ...
- Entity Framework 6.0 Tutorials(9):Stored Procedure Mapping
Code First - Insert, Update, Delete Stored Procedure Mapping: Entity Framework 6 Code-First provides ...
- Entity Framework 6.0 Tutorials(6):Transaction support
Transaction support: Entity Framework by default wraps Insert, Update or Delete operation in a trans ...
- Entity Framework 6.0 Tutorials(3):Code-based Configuration
Code-based Configuration: Entity Framework 6 has introduced code based configuration. Now, you can c ...
- Entity Framework 6.0 Tutorials(2):Async query and Save
Async query and Save: You can take advantage of asynchronous execution of .Net 4.5 with Entity Frame ...
- Entity Framework 6.0 Tutorials(8):Custom Code-First Conventions
Custom Code-First Conventions: Code-First has a set of default behaviors for the models that are ref ...
- Entity Framework 6.0 Tutorials(7):DbSet.AddRange & DbSet.RemoveRange
DbSet.AddRange & DbSet.RemoveRange: DbSet in EF 6 has introduced new methods AddRange & Remo ...
随机推荐
- 关于modelsim添加库的说明
声明:以下纯属个人习惯. 1.工程建好后添加一个编译好的库的方法是:file->new->library选择a map to an existing library.然后将这个库在你这工程 ...
- Linux 环境下安装Maven
1.安装wget命令 如果需要通过使用wget命令,直接通过网络下载maven安装包时,需要在linux系统中安装wget命令. yum -y install wget 2.下载maven安装包 wg ...
- Linux环境安装redis
redis官网地址:http://www.redis.io/ 最新版本:2.8.3 在Linux下安装Redis非常简单,具体步骤如下(官网有说明): 1.下载源码,解压缩后编译源码. $ wget ...
- Maven依赖war开发,找不到war里头的class解决方案
问题描述: 开发一个web系统,需要引用另一个excel.war[在该系统里头是一个excel的导入导出小模块]进行项目 <dependency> <groupId>com.b ...
- windows下通过Git Bash使用Git常用命令
Git跟SVN最大不同的地方就是分布式.SVN的集中式与Git的分布式决定各自的业务场景.既然是分布式的,那么大部分操作就是本地操作.一般Git操作都是通过IDE,比如Eclipse,如果装了Git ...
- Delphi AES加密(转)
(**************************************************************) (* Advanced Encryption Standard (AE ...
- 获取sonar扫描结果
api通过抓包获取 java 1.get和post方法 package com.tools.httpUtil; import java.io.BufferedReader; import java.i ...
- Erlang基础 -- 介绍 -- Erlang特点
前言 Erlang是具有多重范型的编程语言,具有很多特点,主要的特点有以下几个: 函数式 并发性 分布式 健壮性 软实时 热更新 递增式代码加载 动态类型 解释型 函数式 Erlang是函数式编程语言 ...
- unittest框架,调用函数类 和 调用函数外的 方法
- 复制书稿(book) (二分,贪心+dp)
复制书稿(book) 时间限制: 1 Sec 内存限制: 128 MB提交: 3 解决: 1[提交][状态][讨论版][命题人:quanxing] 题目描述 现在要把m本有顺序的书分给k个人复制( ...