mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 18:52:50 +08:00
Update readme.md
This commit is contained in:
parent
4fa1475ab7
commit
b41680adfa
28
readme.md
28
readme.md
@ -124,25 +124,27 @@ fsql.Select<Song>().OrderBy(a => Guid.NewGuid()).Limit(10).ToList();
|
|||||||
> dotnet add package FreeSql.Repository
|
> dotnet add package FreeSql.Repository
|
||||||
|
|
||||||
```csharp
|
```csharp
|
||||||
var repo = uow.GetRepository<Tag>();
|
[Transactional]
|
||||||
repo.DbContextOptions.EnableAddOrUpdateNavigateList = true;
|
public void Add()
|
||||||
|
{
|
||||||
|
var repo = ioc.GetService<BaseRepository<Tag>>();
|
||||||
|
repo.DbContextOptions.EnableAddOrUpdateNavigateList = true;
|
||||||
|
|
||||||
repo.Insert(new Tag {
|
var item = new Tag
|
||||||
|
{
|
||||||
Name = "testaddsublist",
|
Name = "testaddsublist",
|
||||||
Tags = new[] {
|
Tags = new[]
|
||||||
|
{
|
||||||
new Tag { Name = "sub1" },
|
new Tag { Name = "sub1" },
|
||||||
new Tag { Name = "sub2" },
|
new Tag { Name = "sub2" }
|
||||||
new Tag {
|
|
||||||
Name = "sub3",
|
|
||||||
Tags = new[] {
|
|
||||||
new Tag { Name = "sub3_01" }
|
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
}
|
repo.Insert(item);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
参考:[在 asp.net core 中使用 TransactionalAttribute + UnitOfWorkManager 实现多种事务传播](https://github.com/dotnetcore/FreeSql/issues/289)
|
||||||
|
|
||||||
## 💪 Performance
|
## 💪 Performance
|
||||||
|
|
||||||
FreeSql Query & Dapper Query
|
FreeSql Query & Dapper Query
|
||||||
|
Loading…
x
Reference in New Issue
Block a user