diff --git a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/AbstractKeyReadOnlyAppService.cs b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/AbstractKeyReadOnlyAppService.cs
index 5781fb1fa3..b9ffe3359b 100644
--- a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/AbstractKeyReadOnlyAppService.cs
+++ b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/AbstractKeyReadOnlyAppService.cs
@@ -122,9 +122,9 @@ namespace Volo.Abp.Application.Services
/// The query.
protected virtual IQueryable ApplyDefaultSorting(IQueryable query)
{
- if (typeof(TEntity).IsAssignableTo())
+ if (typeof(TEntity).IsAssignableTo())
{
- return query.OrderByDescending(e => ((ICreationAuditedObject)e).CreationTime);
+ return query.OrderByDescending(e => ((IHasCreationTime)e).CreationTime);
}
throw new AbpException("No sorting specified but this query requires sorting. Override the ApplyDefaultSorting method for your application service derived from AbstractKeyReadOnlyAppService!");
diff --git a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/CrudAppService.cs b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/CrudAppService.cs
index 6c06cf95fe..db66881fb7 100644
--- a/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/CrudAppService.cs
+++ b/framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/CrudAppService.cs
@@ -102,9 +102,9 @@ namespace Volo.Abp.Application.Services
protected override IQueryable ApplyDefaultSorting(IQueryable query)
{
- if (typeof(TEntity).IsAssignableTo())
+ if (typeof(TEntity).IsAssignableTo())
{
- return query.OrderByDescending(e => ((ICreationAuditedObject)e).CreationTime);
+ return query.OrderByDescending(e => ((IHasCreationTime)e).CreationTime);
}
else
{