c# - $orderBy with duplicate property in odata v4 -


i have following models:

public class field {     public string name { get; set; }     public int order { get; set; }      public int fieldgroupid { get; set; } }  public class fieldgroup {     public string name { get; set; }     public int order { get; set; }      public virtual icollection<field> field { get; set; } } 

and want query can order first group , field, like:

http://localhost:44300/api/odata/intfieldset?$count=true&$expand=fieldgroup&$orderby=fieldgroup/order,order 

however, when try receive following error:

duplicate property named 'order' not supported in '$orderby'. 

although have same name, not same field. if try order fields different names or 1 of per time, works. ex:

$orderby=fieldgroup/order,name   ||   $orderby=fieldgroup/order   ||   $orderby=order 

it used work on odata v3 not anymore using odata v4.

anyone have faced problem before. can me find out solution?

thanks in advance.

i have same issue using webapi odata 5.6 , 5.7. fixed in version webapi odata 5.7: https://github.com/odata/webapi/issues/376 wait publication of update.


Comments