|
|
|
@ -610,14 +610,23 @@ namespace Admin.Core.Repository
|
|
|
|
|
/// </summary
|
|
|
|
|
/// <param name="entity"博文实体类</param
|
|
|
|
|
/// <returns</returns
|
|
|
|
|
public int Add(TEntity entity)
|
|
|
|
|
public async Task<int> Add(TEntity entity)
|
|
|
|
|
{
|
|
|
|
|
var insert = _db.CopyNew().Insertable(entity);
|
|
|
|
|
//var insert = _db.CopyNew().Insertable(entity);
|
|
|
|
|
//return insert.ExecuteReturnIdentity();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
return await _db.Insertable(entity).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return insert.ExecuteReturnIdentity();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary
|
|
|
|
|
/// 写入实体数据
|
|
|
|
|
/// </summary
|
|
|
|
|