mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 18:52:50 +08:00
## v0.12.5
This commit is contained in:
parent
20e06ef3a2
commit
bfed0cd124
@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0</TargetFrameworks>
|
||||
<Version>0.12.4</Version>
|
||||
<Version>0.12.5</Version>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<Authors>YeXiangQin</Authors>
|
||||
<Description>BaseEntity 是一种极简单的 CodeFirst 开发方式,特别对单表或多表CRUD,利用继承节省了每个实体类的重复属性(创建时间、ID等字段),软件删除等功能,进行 crud 操作时不必时常考虑仓储的使用.</Description>
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net45;net40</TargetFrameworks>
|
||||
<Version>0.12.4</Version>
|
||||
<Version>0.12.5</Version>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<Authors>YeXiangQin</Authors>
|
||||
<Description>FreeSql 扩展包,可实现实体类属性为对象时,以JSON形式映射存储.</Description>
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net45;net40</TargetFrameworks>
|
||||
<Version>0.12.4</Version>
|
||||
<Version>0.12.5</Version>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<Authors>YeXiangQin</Authors>
|
||||
<Description>FreeSql 扩展包,可实现【延时加载】属性.</Description>
|
||||
|
@ -107,8 +107,9 @@ namespace FreeSql
|
||||
internal ConcurrentDictionary<string, EntityState> _statesInternal => _states;
|
||||
TableInfo _tablePriv;
|
||||
protected TableInfo _table => _tablePriv ?? (_tablePriv = _db.Orm.CodeFirst.GetTableByEntity(_entityType));
|
||||
ColumnInfo[] _tableIdentitysPriv;
|
||||
ColumnInfo[] _tableIdentitysPriv, _tableServerTimesPriv;
|
||||
protected ColumnInfo[] _tableIdentitys => _tableIdentitysPriv ?? (_tableIdentitysPriv = _table.Primarys.Where(a => a.Attribute.IsIdentity).ToArray());
|
||||
protected ColumnInfo[] _tableServerTimes => _tableServerTimesPriv ?? (_tableServerTimesPriv = _table.Primarys.Where(a => a.Attribute.ServerTime != DateTimeKind.Unspecified).ToArray());
|
||||
protected Type _entityType = typeof(TEntity);
|
||||
public Type EntityType => _entityType;
|
||||
|
||||
@ -125,6 +126,7 @@ namespace FreeSql
|
||||
_entityType = entityType;
|
||||
_tablePriv = newtb ?? throw new Exception("DbSet.AsType 参数错误,请传入正确的实体类型");
|
||||
_tableIdentitysPriv = null;
|
||||
_tableServerTimesPriv = null;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net45;net40</TargetFrameworks>
|
||||
<Version>0.12.4</Version>
|
||||
<Version>0.12.5</Version>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<Authors>YeXiangQin</Authors>
|
||||
<Description>FreeSql is the most convenient ORM in .NetCore, .NetFramework, And Xamarin. It supports Mysql, Postgresql, SqlServer, Oracle, Sqlite, And Odbc.</Description>
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net45;net40</TargetFrameworks>
|
||||
<Version>0.12.4</Version>
|
||||
<Version>0.12.5</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>
|
||||
|
@ -72,17 +72,9 @@ namespace FreeSql.DataAnnotations
|
||||
/// </summary>
|
||||
public bool CanUpdate { get => _CanUpdate ?? true; set => _CanUpdate = value; }
|
||||
|
||||
internal DateTimeKind? _ServerTime;
|
||||
/// <summary>
|
||||
/// 标记属性为数据库服务器时间(utc/local),在插入的时候使用类似 getdate() 执行
|
||||
/// </summary>
|
||||
public DateTimeKind ServerTime
|
||||
{
|
||||
get => _ServerTime ?? DateTimeKind.Local;
|
||||
set
|
||||
{
|
||||
_ServerTime = value == DateTimeKind.Unspecified ? DateTimeKind.Local : value;
|
||||
}
|
||||
}
|
||||
public DateTimeKind ServerTime { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net45;net40</TargetFrameworks>
|
||||
<Version>0.12.4</Version>
|
||||
<Version>0.12.5</Version>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<Authors>YeXiangQin</Authors>
|
||||
<Description>FreeSql is the most convenient ORM in .NetCore, .NetFramework, And Xamarin. It supports Mysql, Postgresql, SqlServer, Oracle, Sqlite, And Odbc.</Description>
|
||||
|
@ -128,7 +128,7 @@ namespace FreeSql.Internal
|
||||
if (trycol._Position != null) attr._Position = trycol.Position;
|
||||
if (trycol._CanInsert != null) attr._CanInsert = trycol.CanInsert;
|
||||
if (trycol._CanUpdate != null) attr._CanUpdate = trycol.CanUpdate;
|
||||
if (trycol._ServerTime != null) attr._ServerTime = trycol._ServerTime;
|
||||
if (trycol.ServerTime != DateTimeKind.Unspecified) attr.ServerTime = trycol.ServerTime;
|
||||
}
|
||||
var attrs = proto.GetCustomAttributes(typeof(ColumnAttribute), false);
|
||||
foreach (var tryattrobj in attrs)
|
||||
@ -147,7 +147,7 @@ namespace FreeSql.Internal
|
||||
if (tryattr._Position != null) attr._Position = tryattr.Position;
|
||||
if (tryattr._CanInsert != null) attr._CanInsert = tryattr.CanInsert;
|
||||
if (tryattr._CanUpdate != null) attr._CanUpdate = tryattr.CanUpdate;
|
||||
if (tryattr._ServerTime != null) attr._ServerTime = tryattr.ServerTime;
|
||||
if (tryattr.ServerTime != DateTimeKind.Unspecified) attr.ServerTime = tryattr.ServerTime;
|
||||
}
|
||||
ColumnAttribute ret = null;
|
||||
if (!string.IsNullOrEmpty(attr.Name)) ret = attr;
|
||||
@ -162,7 +162,7 @@ namespace FreeSql.Internal
|
||||
if (attr._Position != null) ret = attr;
|
||||
if (attr._CanInsert != null) ret = attr;
|
||||
if (attr._CanUpdate != null) ret = attr;
|
||||
if (attr._ServerTime != null) ret = attr;
|
||||
if (attr.ServerTime != DateTimeKind.Unspecified) ret = attr;
|
||||
if (ret != null && ret.MapType == null) ret.MapType = proto.PropertyType;
|
||||
return ret;
|
||||
}
|
||||
|
@ -189,7 +189,7 @@ namespace FreeSql.Internal
|
||||
// else if (Math.Abs(dt.Subtract(DateTime.UtcNow).TotalSeconds) < 60)
|
||||
// col.DbDefaultValue = common.NowUtc;
|
||||
//}
|
||||
if (colattr._ServerTime != null && new[] { typeof(DateTime), typeof(DateTimeOffset) }.Contains(colattr.MapType.NullableTypeOrThis()))
|
||||
if (colattr.ServerTime != DateTimeKind.Unspecified && new[] { typeof(DateTime), typeof(DateTimeOffset) }.Contains(colattr.MapType.NullableTypeOrThis()))
|
||||
{
|
||||
col.DbDefaultValue = colattr.ServerTime == DateTimeKind.Local ? common.Now : common.NowUtc;
|
||||
col.DbInsertValue = colattr.ServerTime == DateTimeKind.Local ? common.Now : common.NowUtc;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net452;net451;net45;net40</TargetFrameworks>
|
||||
<Version>0.12.4</Version>
|
||||
<Version>0.12.5</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.12.4</Version>
|
||||
<Version>0.12.5</Version>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<Authors>YeXiangQin</Authors>
|
||||
<Description>FreeSql 数据库实现,基于 MySql 5.6</Description>
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net45;net40</TargetFrameworks>
|
||||
<Version>0.12.4</Version>
|
||||
<Version>0.12.5</Version>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<Authors>YeXiangQin</Authors>
|
||||
<Description>FreeSql 数据库 Odbc 实现,基于 {Oracle}、{SQL Server}、{MySQL ODBC 8.0 Unicode Driver}、{PostgreSQL Unicode(x64)} 专用访问实现,以及通用 Odbc 访问所有数据库</Description>
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net45;net40</TargetFrameworks>
|
||||
<Version>0.12.4</Version>
|
||||
<Version>0.12.5</Version>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<Authors>YeXiangQin</Authors>
|
||||
<Description>FreeSql 数据库实现,基于 Oracle 11</Description>
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net461;net452;net451;net45</TargetFrameworks>
|
||||
<Version>0.12.4</Version>
|
||||
<Version>0.12.5</Version>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<Authors>YeXiangQin</Authors>
|
||||
<Description>FreeSql 数据库实现,基于 PostgreSQL 9.5</Description>
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net451;net45;net40</TargetFrameworks>
|
||||
<Version>0.12.4</Version>
|
||||
<Version>0.12.5</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;net40</TargetFrameworks>
|
||||
<Version>0.12.4</Version>
|
||||
<Version>0.12.5</Version>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<Authors>YeXiangQin</Authors>
|
||||
<Description>FreeSql 数据库实现,基于 Sqlite 3.0,支持 .NetCore、.NetFramework、Xamarin</Description>
|
||||
|
Loading…
x
Reference in New Issue
Block a user