Refactors queryfilter name attribute
This commit is contained in:
parent
028bfeb776
commit
742d90bb98
|
@ -14,7 +14,7 @@ public abstract class AttributedQueryFilter : IQueryFilter
|
||||||
var properties = GetType().GetProperties();
|
var properties = GetType().GetProperties();
|
||||||
foreach (var propertyInfo in properties)
|
foreach (var propertyInfo in properties)
|
||||||
{
|
{
|
||||||
var attribute = propertyInfo.GetCustomAttribute<QueryFilterAttribute>();
|
var attribute = propertyInfo.GetCustomAttribute<QueryFilterNameAttribute>();
|
||||||
|
|
||||||
if (attribute == null)
|
if (attribute == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -2,23 +2,23 @@
|
||||||
|
|
||||||
public class CardQueryFilter : AttributedQueryFilter
|
public class CardQueryFilter : AttributedQueryFilter
|
||||||
{
|
{
|
||||||
[QueryFilter("id")] public int? Id { get; set; }
|
[QueryFilterName("id")] public int? Id { get; set; }
|
||||||
|
|
||||||
[QueryFilter("name")] public string? Name { get; set; }
|
[QueryFilterName("name")] public string? Name { get; set; }
|
||||||
|
|
||||||
[QueryFilter("set_id")] public int? SetId { get; set; }
|
[QueryFilterName("set_id")] public int? SetId { get; set; }
|
||||||
|
|
||||||
[QueryFilter("illustrator")] public string? Artist { get; set; }
|
[QueryFilterName("illustrator")] public string? Artist { get; set; }
|
||||||
|
|
||||||
[QueryFilter("p_no")] public string? PrintedNumber { get; set; }
|
[QueryFilterName("p_no")] public string? PrintedNumber { get; set; }
|
||||||
|
|
||||||
[QueryFilter("uuid")] public int? Uuid { get; set; }
|
[QueryFilterName("uuid")] public int? Uuid { get; set; }
|
||||||
|
|
||||||
[QueryFilter("rarity")] public string? Rarity { get; set; }
|
[QueryFilterName("rarity")] public string? Rarity { get; set; }
|
||||||
|
|
||||||
[QueryFilter("subtype")] public string? Subtype { get; set; }
|
[QueryFilterName("subtype")] public string? Subtype { get; set; }
|
||||||
|
|
||||||
[QueryFilter("type")] public string? Type { get; set; }
|
[QueryFilterName("type")] public string? Type { get; set; }
|
||||||
|
|
||||||
[QueryFilter("set_code")] public string? SetCode { get; set; }
|
[QueryFilterName("set_code")] public string? SetCode { get; set; }
|
||||||
}
|
}
|
|
@ -3,14 +3,14 @@
|
||||||
namespace JpnCardsPokemonSdk.Utils.QueryFilter;
|
namespace JpnCardsPokemonSdk.Utils.QueryFilter;
|
||||||
|
|
||||||
[AttributeUsage(AttributeTargets.Property)]
|
[AttributeUsage(AttributeTargets.Property)]
|
||||||
public class QueryFilterAttribute : Attribute
|
public class QueryFilterNameAttribute : Attribute
|
||||||
{
|
{
|
||||||
public QueryFilterAttribute(string? paramName)
|
public QueryFilterNameAttribute(string? paramName)
|
||||||
{
|
{
|
||||||
ParamName = paramName;
|
ParamName = paramName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public QueryFilterAttribute() : this(null)
|
public QueryFilterNameAttribute() : this(null)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue