diff --git a/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Extensions/LongExtensions.cs b/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Extensions/LongExtensions.cs deleted file mode 100644 index 408f6a63..00000000 --- a/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Extensions/LongExtensions.cs +++ /dev/null @@ -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; - } -} diff --git a/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Services/DefaultDataService.cs b/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Services/DefaultDataService.cs index eb7288a0..8c90fa9f 100644 --- a/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Services/DefaultDataService.cs +++ b/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Services/DefaultDataService.cs @@ -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 diff --git a/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Services/ExceptionService.cs b/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Services/ExceptionService.cs index f4bcf935..3aabff26 100644 --- a/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Services/ExceptionService.cs +++ b/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Services/ExceptionService.cs @@ -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)); } }