mirror of
https://github.com/dotnetcore/FreeSql.git
synced 2026-02-04 15:30:53 +08:00
update
17
实体特性.md
17
实体特性.md
@@ -27,27 +27,24 @@ class Topic {
|
||||
|
||||
* 当没有指明主键时,标记自增的成员将成为主键;
|
||||
|
||||
## 唯一键(Unique Key)
|
||||
## 唯一键(Unique Key)、索引(Index)
|
||||
|
||||
```csharp
|
||||
class AddUniquesInfo {
|
||||
|
||||
[Index("uk_phone", "phone", true)]
|
||||
[Index("uk_group_index", "group,index", true)]
|
||||
[Index("uk_group_index22", "group, index22 desc", true)]
|
||||
class AddUniquesInfo
|
||||
{
|
||||
public Guid id { get; set; }
|
||||
[Column(Unique = "uk_phone")]
|
||||
public string phone { get; set; }
|
||||
|
||||
[Column(Unique = "uk_group_index, uk_group_index22")]
|
||||
public string group { get; set; }
|
||||
|
||||
[Column(Unique = "uk_group_index")]
|
||||
public int index { get; set; }
|
||||
|
||||
[Column(Unique = "uk_group_index22")]
|
||||
public string index22 { get; set; }
|
||||
}
|
||||
```
|
||||
|
||||
唯一键,在多个属性指定相同的标识,代表联合键;可使用逗号分割多个 UniqueKey 名。
|
||||
> 第三个参数 true 的时候是唯一键,false 的时候是普通索引。
|
||||
|
||||
## 数据库类型(DbType)
|
||||
|
||||
|
||||
5
更新日志.md
5
更新日志.md
@@ -1,6 +1,11 @@
|
||||
|
||||
完整版本:年数-月-日-当日版本号,FreeSql、FreeSql.Repository、FreeSql.DbContext 版本号相同。
|
||||
|
||||
## v0.10.7
|
||||
|
||||
- 增加 IndexAttribute 特性,自动迁移索引,以及对应的 FluentApi 方法;
|
||||
- 移除 ColumnAttribute.Unique 属性设置,改为 IndexAttribute 特性设置唯一键;
|
||||
|
||||
## v0.10.6
|
||||
|
||||
- 优化 DbContext/Repository ManyToMany联级保存功能,当是新增数据时不查询中间表记录对比差异(直接插入);
|
||||
|
||||
Reference in New Issue
Block a user