0
我不知道發送複雜對象的最佳方式是何時發送複雜對象僅用於查找數據目的。我有一個網格,其中分頁,過濾,排序等將完成嚴重的一面。所以我必須發送每個請求的所有數據。發送複雜對象GET vs POST
public class DataConfiguratorDto
{
[Required]
public Paging Paging { get; set; }
public Sorting Sorting { get; set; }
public IList<Filtering> FlitersList { get; set; }
}
public enum FilterCondition
{
Equals,
Contains,
MoreThan,
LessThan,
}
public class Paging
{
public int RowNumberStart { get; set; }
[GreaterThan(nameof(RowNumberStart))]
public int RowNumberEnd { get; set; }
}
public class Filtering
{
[Required]
public string ColumnName { get; set; }
[Required]
public object FilterValue { get; set; }
[Required]
public FilterCondition FilterCondition { get; set; }
[Required]
public FilterType FilterType { get; set; }
}
public class Sorting
{
[Required]
public SortOption SortOption;
[Required]
public string ColumnName { get; set; }
}
public enum SortOption
{
Asc,
Desc
}
public enum FilterType
{
And,
Or
}
現在我可以使用POST但不是它打破它的目的?
什麼是最好的選擇做到這一點?