af1152b001
Refactored all C# test files to use explicit namespace declarations and moved all using directives inside the namespace block for consistency. Updated assembly info and cache files to reflect the new build. Adjusted MvcTestingAppManifest.json to use fully qualified assembly names. No functional changes; all updates are related to code style, organization, and project metadata.
42 lines
1.3 KiB
C#
42 lines
1.3 KiB
C#
// <copyright file="BaseJellyfinApiController.cs" company="PlaceholderCompany">
|
|
// Copyright (c) PlaceholderCompany. All rights reserved.
|
|
// </copyright>
|
|
|
|
namespace Jellyfin.Api;
|
|
|
|
using System.Collections.Generic;
|
|
using System.Net.Mime;
|
|
using Jellyfin.Api.Results;
|
|
using Jellyfin.Extensions.Json;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
/// <summary>
|
|
/// Base api controller for the API setting a default route.
|
|
/// </summary>
|
|
[ApiController]
|
|
[Route("[controller]")]
|
|
[Produces(
|
|
MediaTypeNames.Application.Json,
|
|
JsonDefaults.CamelCaseMediaType,
|
|
JsonDefaults.PascalCaseMediaType)]
|
|
public class BaseJellyfinApiController : ControllerBase
|
|
{
|
|
/// <summary>
|
|
/// Create a new <see cref="OkResult{T}"/>.
|
|
/// </summary>
|
|
/// <param name="value">The value to return.</param>
|
|
/// <typeparam name="T">The type to return.</typeparam>
|
|
/// <returns>The <see cref="ActionResult{T}"/>.</returns>
|
|
protected ActionResult<IEnumerable<T>> Ok<T>(IEnumerable<T>? value)
|
|
=> new OkResult<IEnumerable<T>?>(value);
|
|
|
|
/// <summary>
|
|
/// Create a new <see cref="OkResult{T}"/>.
|
|
/// </summary>
|
|
/// <param name="value">The value to return.</param>
|
|
/// <typeparam name="T">The type to return.</typeparam>
|
|
/// <returns>The <see cref="ActionResult{T}"/>.</returns>
|
|
protected ActionResult<T> Ok<T>(T value)
|
|
=> new OkResult<T>(value);
|
|
}
|