feat: 移除 LongExtensions 扩展方法
This commit is contained in:
parent
15007cd2fc
commit
b32e28ca2c
|
@ -1,19 +0,0 @@
|
|||
namespace BootstrapAdmin.DataAccess.PetaPoco.Extensions;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static class LongExtensions
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="source"></param>
|
||||
/// <returns></returns>
|
||||
public static int ToInt32(this long source)
|
||||
{
|
||||
int ret;
|
||||
_ = int.TryParse(source.ToString(), out ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
|
@ -3,7 +3,6 @@
|
|||
// Website: https://www.blazor.zone or https://argozhang.github.io/
|
||||
|
||||
using BootstrapAdmin.DataAccess.Models;
|
||||
using BootstrapAdmin.DataAccess.PetaPoco.Extensions;
|
||||
using BootstrapAdmin.Web.Core;
|
||||
using BootstrapAdmin.Web.Extensions;
|
||||
using BootstrapBlazor.Components;
|
||||
|
@ -84,7 +83,7 @@ class DefaultDataService<TModel> : DataServiceBase<TModel> where TModel : class,
|
|||
{
|
||||
var items = await Database.PageAsync<TModel>(option);
|
||||
|
||||
ret.TotalCount = items.TotalItems.ToInt32();
|
||||
ret.TotalCount = Convert.ToInt32(items.TotalItems);
|
||||
ret.Items = items.Items;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using BootstrapAdmin.DataAccess.Models;
|
||||
using BootstrapAdmin.DataAccess.PetaPoco.Extensions;
|
||||
using BootstrapAdmin.Web.Core;
|
||||
using PetaPoco;
|
||||
|
||||
|
@ -55,6 +54,6 @@ class ExceptionService : BaseDatabase, IException
|
|||
}
|
||||
|
||||
var data = Database.Page<Error>(pageIndex, pageItems, sql);
|
||||
return (data.Items, data.TotalItems.ToInt32());
|
||||
return (data.Items, Convert.ToInt32(data.TotalItems));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue