mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 18:52:50 +08:00
v0.7.16
This commit is contained in:
parent
380534dfd5
commit
7460ffffaa
@ -42,7 +42,6 @@ public abstract class BaseEntity
|
||||
/// <summary>
|
||||
/// 开启工作单元事务
|
||||
/// </summary>
|
||||
/// <param name="level"></param>
|
||||
/// <returns></returns>
|
||||
public static IUnitOfWork Begin() => Begin(null);
|
||||
public static IUnitOfWork Begin(IsolationLevel? level)
|
||||
@ -118,28 +117,28 @@ public abstract class BaseEntity<TEntity> : BaseEntity where TEntity : class
|
||||
/// <summary>
|
||||
/// 插入数据
|
||||
/// </summary>
|
||||
async public virtual Task Insert()
|
||||
public virtual Task<TEntity> Insert()
|
||||
{
|
||||
this.CreateTime = DateTime.Now;
|
||||
if (this.Repository == null)
|
||||
this.Repository = Orm.GetRepository<TEntity>();
|
||||
|
||||
this.Repository.UnitOfWork = UnitOfWork.Current.Value;
|
||||
await this.Repository.InsertAsync(this as TEntity);
|
||||
return this.Repository.InsertAsync(this as TEntity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新或插入
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
async public virtual Task Save()
|
||||
public virtual Task<TEntity> Save()
|
||||
{
|
||||
this.UpdateTime = DateTime.Now;
|
||||
if (this.Repository == null)
|
||||
this.Repository = Orm.GetRepository<TEntity>();
|
||||
|
||||
this.Repository.UnitOfWork = UnitOfWork.Current.Value;
|
||||
await this.Repository.InsertOrUpdateAsync(this as TEntity);
|
||||
return this.Repository.InsertOrUpdateAsync(this as TEntity);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,8 @@ namespace base_entity
|
||||
{
|
||||
using (var uow = BaseEntity.Begin())
|
||||
{
|
||||
var itt = await UserGroup.Find(1);
|
||||
var id = (await new User1().Save()).Id;
|
||||
uow.Commit();
|
||||
}
|
||||
|
||||
var ug1 = new UserGroup();
|
||||
|
@ -23,7 +23,6 @@
|
||||
<summary>
|
||||
开启工作单元事务
|
||||
</summary>
|
||||
<param name="level"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:BaseEntity`1.Delete">
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
|
||||
<Version>0.7.15</Version>
|
||||
<Version>0.7.16</Version>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<Authors>YeXiangQin</Authors>
|
||||
<Description>FreeSql 扩展包,可实现【延时加载】属性.</Description>
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
|
||||
<Version>0.7.15</Version>
|
||||
<Version>0.7.16</Version>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<Authors>YeXiangQin</Authors>
|
||||
<Description>FreeSql is the most convenient ORM in dotnet. It supports Mysql, Postgresql, SqlServer, Oracle and Sqlite.</Description>
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
|
||||
<Version>0.7.15</Version>
|
||||
<Version>0.7.16</Version>
|
||||
<Authors>YeXiangQin</Authors>
|
||||
<Description>FreeSql Implementation of General Repository, Support MySql/SqlServer/PostgreSQL/Oracle/Sqlite, and read/write separation、and split table.</Description>
|
||||
<PackageProjectUrl>https://github.com/2881099/FreeSql/wiki/Repository</PackageProjectUrl>
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
|
||||
<Version>0.7.15</Version>
|
||||
<Version>0.7.16</Version>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<Authors>YeXiangQin</Authors>
|
||||
<Description>FreeSql is the most convenient ORM in dotnet. It supports Mysql, Postgresql, SqlServer, Oracle and Sqlite.</Description>
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net452</TargetFrameworks>
|
||||
<Version>0.7.15</Version>
|
||||
<Version>0.7.16</Version>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<Authors>YeXiangQin</Authors>
|
||||
<Description>FreeSql 数据库实现,基于 MySql 5.6</Description>
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
|
||||
<Version>0.7.15</Version>
|
||||
<Version>0.7.16</Version>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<Authors>YeXiangQin</Authors>
|
||||
<Description>FreeSql 数据库实现,基于 MySql 5.6</Description>
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
|
||||
<Version>0.7.15</Version>
|
||||
<Version>0.7.16</Version>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<Authors>YeXiangQin</Authors>
|
||||
<Description>FreeSql 数据库实现,基于 Oracle 11</Description>
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
|
||||
<Version>0.7.15</Version>
|
||||
<Version>0.7.16</Version>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<Authors>YeXiangQin</Authors>
|
||||
<Description>FreeSql 数据库实现,基于 PostgreSQL 9.5</Description>
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net451</TargetFrameworks>
|
||||
<Version>0.7.15</Version>
|
||||
<Version>0.7.16</Version>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<Authors>YeXiangQin</Authors>
|
||||
<Description>FreeSql 数据库实现,基于 SqlServer 2005+,并根据版本适配分页方法:row_number 或 offset fetch next</Description>
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
|
||||
<Version>0.7.15</Version>
|
||||
<Version>0.7.16</Version>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<Authors>YeXiangQin</Authors>
|
||||
<Description>FreeSql 数据库实现,基于 Sqlite 3.0</Description>
|
||||
|
Loading…
x
Reference in New Issue
Block a user