mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-10 08:13:20 +01:00
Pushing missing changes
This commit is contained in:
31
MediaBrowser.Common/Net/Handlers/BaseActionHandler.cs
Normal file
31
MediaBrowser.Common/Net/Handlers/BaseActionHandler.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using MediaBrowser.Common.Kernel;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Common.Net.Handlers
|
||||
{
|
||||
/// <summary>
|
||||
/// Class BaseActionHandler
|
||||
/// </summary>
|
||||
/// <typeparam name="TKernelType">The type of the T kernel type.</typeparam>
|
||||
public abstract class BaseActionHandler<TKernelType> : BaseSerializationHandler<TKernelType, EmptyRequestResult>
|
||||
where TKernelType : IKernel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the object to serialize.
|
||||
/// </summary>
|
||||
/// <returns>Task{EmptyRequestResult}.</returns>
|
||||
protected override async Task<EmptyRequestResult> GetObjectToSerialize()
|
||||
{
|
||||
await ExecuteAction();
|
||||
|
||||
return new EmptyRequestResult();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs the action.
|
||||
/// </summary>
|
||||
/// <returns>Task.</returns>
|
||||
protected abstract Task ExecuteAction();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user