INamedObject
This commit is contained in:
@@ -11,6 +11,8 @@ public abstract class BaseItemHandler<TEntity, TUpdateMsg>(IApiServer server)
|
||||
where TEntity : class, IDataObject
|
||||
where TUpdateMsg : ApiMessage
|
||||
{
|
||||
protected readonly bool isNamedObjectType = typeof(TEntity).IsAssignableTo(typeof(INamedObject));
|
||||
|
||||
protected virtual bool RegisterGetAll => true;
|
||||
protected virtual bool RegisterPost => true;
|
||||
|
||||
@@ -47,6 +49,8 @@ public abstract class BaseItemHandler<TEntity, TUpdateMsg>(IApiServer server)
|
||||
|
||||
protected virtual IQueryable<TEntity> SortEntities(IQueryable<TEntity> entities)
|
||||
{
|
||||
if (isNamedObjectType)
|
||||
return entities.OrderBy(n => ((INamedObject)n).Name);
|
||||
return entities;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<Version>2.8.1</Version>
|
||||
<Version>2.8.2</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user