mirror of
https://github.com/ckaczor/ChrisKaczor.MinifluxClient.git
synced 2026-01-14 01:25:40 -05:00
30 lines
641 B
C#
30 lines
641 B
C#
using System.Reflection;
|
|
|
|
namespace ChrisKaczor.MinifluxClient;
|
|
|
|
[QueryParameterName("order")]
|
|
public enum SortField
|
|
{
|
|
[QueryParameterName("id")]
|
|
Id,
|
|
|
|
[QueryParameterName("status")]
|
|
Status,
|
|
|
|
[QueryParameterName("published_at")]
|
|
PublishedAt,
|
|
|
|
[QueryParameterName("category_title")]
|
|
CategoryTitle,
|
|
|
|
[QueryParameterName("category_id")]
|
|
CategoryId
|
|
}
|
|
|
|
internal static class SortFieldExtensions
|
|
{
|
|
extension(SortField)
|
|
{
|
|
internal static string QueryParameterName => typeof(SortField).GetCustomAttribute<QueryParameterNameAttribute>()?.Name ?? throw new InvalidOperationException();
|
|
}
|
|
} |