Update readme.md

This commit is contained in:
2881099 2020-04-25 17:08:36 +08:00 committed by GitHub
parent 4fa1475ab7
commit b41680adfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -124,25 +124,27 @@ fsql.Select<Song>().OrderBy(a => Guid.NewGuid()).Limit(10).ToList();
> dotnet add package FreeSql.Repository
```csharp
var repo = uow.GetRepository<Tag>();
repo.DbContextOptions.EnableAddOrUpdateNavigateList = true;
[Transactional]
public void Add()
{
var repo = ioc.GetService<BaseRepository<Tag>>();
repo.DbContextOptions.EnableAddOrUpdateNavigateList = true;
repo.Insert(new Tag {
var item = new Tag
{
Name = "testaddsublist",
Tags = new[] {
Tags = new[]
{
new Tag { Name = "sub1" },
new Tag { Name = "sub2" },
new Tag {
Name = "sub3",
Tags = new[] {
new Tag { Name = "sub3_01" }
new Tag { Name = "sub2" }
}
}
}
}
});
};
repo.Insert(item);
}
```
参考:[在 asp.net core 中使用 TransactionalAttribute + UnitOfWorkManager 实现多种事务传播](https://github.com/dotnetcore/FreeSql/issues/289)
## 💪 Performance
FreeSql Query & Dapper Query