Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/300.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Refit:是否有方法发送查询中复杂对象的列表_C#_Refit - Fatal编程技术网

C# Refit:是否有方法发送查询中复杂对象的列表

C# Refit:是否有方法发送查询中复杂对象的列表,c#,refit,C#,Refit,正在尝试使用Refit向控制器发送请求: [HttpGet("api/users/{userId}/appointments")] public async Task Get(Guid userId, [FromQuery] FilterRow[] filters = null) {} 添加了此方法的接口: [Get("/api/users/{userId}/appointments")] Task<IEnumerable> Get([AliasAs("userId")] Guid

正在尝试使用Refit向控制器发送请求:

[HttpGet("api/users/{userId}/appointments")]
public async Task Get(Guid userId, [FromQuery] FilterRow[] filters = null) {}
添加了此方法的接口:

[Get("/api/users/{userId}/appointments")]
Task<IEnumerable> Get([AliasAs("userId")] Guid userId, [AliasAs("filters")] FilterRow[] filters);
已尝试添加UrlParameterFormatter。但是对于它的函数格式来说,来自这个对象的独立值。使用IFormattable解决了此问题,但即使这样,它也无法正常工作(控制器未获得任何值)

public class FilterRow
{
    public string FieldName { get; set; }
    public string FilterValue { get; set; }
    public FilterCondition FilterCondition { get; set; }
}

public enum FilterCondition
{
    Equals = 0,
    LessThan = 1,
    LessThanOrEqual = 2,
    GreaterThan = 3,
    GreaterThanOrEqual = 4,
    NotEquals = 5
}