mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-07-15 23:13:40 +08:00
fix issue #I3W5YR
This commit is contained in:
parent
8608ce78f5
commit
7893fe3024
@ -27,12 +27,12 @@ namespace OpenAuth.App
|
|||||||
/// 按id批量删除
|
/// 按id批量删除
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="ids"></param>
|
/// <param name="ids"></param>
|
||||||
public void Delete(long[] ids)
|
public void Delete(decimal[] ids)
|
||||||
{
|
{
|
||||||
Repository.Delete(u => ids.Contains(u.Id));
|
Repository.Delete(u => ids.Contains(u.Id));
|
||||||
}
|
}
|
||||||
|
|
||||||
public T Get(long id)
|
public T Get(decimal id)
|
||||||
{
|
{
|
||||||
return Repository.FirstOrDefault(u => u.Id == id);
|
return Repository.FirstOrDefault(u => u.Id == id);
|
||||||
}
|
}
|
||||||
|
@ -275,7 +275,7 @@ namespace OpenAuth.App
|
|||||||
{
|
{
|
||||||
throw new Exception($"未能找到表{sysTableInfo.TableName}的主键字段");
|
throw new Exception($"未能找到表{sysTableInfo.TableName}的主键字段");
|
||||||
}
|
}
|
||||||
if (primarykey.ColumnType == "decimal" || primarykey.ColumnType == "numberic") //是否为数字
|
if (primarykey.ColumnType == "decimal" || primarykey.ColumnType == "numeric") //是否为数字
|
||||||
{
|
{
|
||||||
if(primarykey.IsIncrement) //是否自增
|
if(primarykey.IsIncrement) //是否自增
|
||||||
{
|
{
|
||||||
@ -386,7 +386,7 @@ namespace OpenAuth.App
|
|||||||
{
|
{
|
||||||
throw new Exception($"未能找到表{sysTableInfo.TableName}的主键字段");
|
throw new Exception($"未能找到表{sysTableInfo.TableName}的主键字段");
|
||||||
}
|
}
|
||||||
if (primarykey.ColumnType == "decimal" || primarykey.ColumnType == "numberic") //是否为数字
|
if (primarykey.ColumnType == "decimal" || primarykey.ColumnType == "numeric") //是否为数字
|
||||||
{
|
{
|
||||||
if(primarykey.IsIncrement) //是否自增
|
if(primarykey.IsIncrement) //是否自增
|
||||||
{
|
{
|
||||||
@ -394,7 +394,7 @@ namespace OpenAuth.App
|
|||||||
}
|
}
|
||||||
else //普通的雪花算法生成id
|
else //普通的雪花算法生成id
|
||||||
{
|
{
|
||||||
domainContent = domainContent.Replace("{KeyTypeName}", "long");
|
domainContent = domainContent.Replace("{KeyTypeName}", "decimal");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -458,7 +458,7 @@ namespace OpenAuth.App
|
|||||||
{
|
{
|
||||||
throw new Exception($"未能找到表{tableInfo.TableName}的主键字段");
|
throw new Exception($"未能找到表{tableInfo.TableName}的主键字段");
|
||||||
}
|
}
|
||||||
if (primarykey.ColumnType == "decimal" || primarykey.ColumnType == "numberic") //是否为数字
|
if (primarykey.ColumnType == "decimal" || primarykey.ColumnType == "numeric") //是否为数字
|
||||||
{
|
{
|
||||||
if(primarykey.IsIncrement) //是否自增
|
if(primarykey.IsIncrement) //是否自增
|
||||||
{
|
{
|
||||||
|
@ -10,7 +10,7 @@ namespace OpenAuth.Repository.Core
|
|||||||
public class LongEntity :BaseEntity
|
public class LongEntity :BaseEntity
|
||||||
{
|
{
|
||||||
[Browsable(false)]
|
[Browsable(false)]
|
||||||
public long Id { get; set; }
|
public decimal Id { get; set; }
|
||||||
public override bool KeyIsNull()
|
public override bool KeyIsNull()
|
||||||
{
|
{
|
||||||
return Id == 0;
|
return Id == 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user