优化接口、仓储层
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
using Infrastructure.Attribute;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using ZR.Repository.DbProvider;
|
||||
|
||||
namespace ZR.Repository.System
|
||||
{
|
||||
public class BaseRepository : SugarDbContext
|
||||
{
|
||||
protected void PrintLog()
|
||||
{
|
||||
//调式代码 用来打印SQL
|
||||
Db.Aop.OnLogExecuting = (sql, pars) =>
|
||||
{
|
||||
Console.WriteLine("【SQL语句】" + sql.ToLower() + "\r\n" + Db.Utilities.SerializeObject(pars.ToDictionary(it => it.ParameterName, it => it.Value)));
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Infrastructure.Attribute;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -7,11 +8,12 @@ using ZR.Model.System.Generate;
|
||||
|
||||
namespace ZR.Repository.System
|
||||
{
|
||||
[AppService(ServiceLifetime = LifeTime.Transient)]
|
||||
public class GenTableRepository : BaseRepository<GenTable>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
[AppService(ServiceLifetime = LifeTime.Transient)]
|
||||
public class GenTableColumnRepository : BaseRepository<GenTableColumn>
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -44,8 +44,7 @@ namespace ZR.Repository.System
|
||||
/// <returns></returns>
|
||||
public long InsertDictData(SysDictData dict)
|
||||
{
|
||||
var result = Context.Insertable(dict).IgnoreColumns(it => new { dict.Update_by })
|
||||
.ExecuteReturnIdentity();
|
||||
var result = InsertReturnBigIdentity(dict);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -76,7 +75,7 @@ namespace ZR.Repository.System
|
||||
/// <returns></returns>
|
||||
public int DeleteDictDataByIds(long[] dictCodes)
|
||||
{
|
||||
return Context.Deleteable<SysDictData>().In(dictCodes).ExecuteCommand();
|
||||
return Delete(dictCodes);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Infrastructure.Attribute;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -7,6 +8,7 @@ using ZR.Model.System;
|
||||
|
||||
namespace ZR.Repository.System
|
||||
{
|
||||
[AppService(ServiceLifetime = LifeTime.Transient)]
|
||||
public class SysPostRepository : BaseRepository<SysPost>
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user