mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-12-26 18:05:48 +08:00
v0.1.5
- 增加 IsSyncStructureToUpper 参数,以便适应 Oracle 大小写使用习惯; - FreeSql.Repository 增加 GuidRepository 类,适用 Insert 方法无须返回插入的数据; - FreeSql.Repository 增加 IFreeSql 扩展方法 GetRepository、GetGuidRepository;
This commit is contained in:
34
FreeSql.Repository/GuidRepository.cs
Normal file
34
FreeSql.Repository/GuidRepository.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FreeSql {
|
||||
public class GuidRepository<TEntity> :
|
||||
BaseRepository<TEntity, Guid>
|
||||
where TEntity : class {
|
||||
|
||||
public GuidRepository(IFreeSql fsql) : base(fsql) {
|
||||
}
|
||||
|
||||
public override List<TEntity> Insert(List<TEntity> entity) {
|
||||
_fsql.Insert<TEntity>().AppendData(entity).ExecuteAffrows();
|
||||
return entity;
|
||||
}
|
||||
|
||||
async public override Task<List<TEntity>> InsertAsync(List<TEntity> entity) {
|
||||
await _fsql.Insert<TEntity>().AppendData(entity).ExecuteAffrowsAsync();
|
||||
return entity;
|
||||
}
|
||||
|
||||
public override TEntity Insert(TEntity entity) {
|
||||
_fsql.Insert<TEntity>().AppendData(entity).ExecuteAffrows();
|
||||
return entity;
|
||||
}
|
||||
|
||||
async public override Task<TEntity> InsertAsync(TEntity entity) {
|
||||
await _fsql.Insert<TEntity>().AppendData(entity).ExecuteAffrowsAsync();
|
||||
return entity;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user