3

I have OdataService with CustDetails table (I am using Entity Framework). In the table I have column PostalCode of string type. When I sort the data it working fine. It sort the data by considering it as string type. But my requirement is, in my PostalCode all values are integer value only , so I need to sort the data by considering it as integer type. Is it possible to change the field data type while sorting ?

Actual sorted Result:

100,
1100,
12,
2,
200

But My expected result is

2,
12,
100,
200,
1100

Please help me to overcome this. Note: I am not able to change the data type in database.

4

1 回答 1

0

OData 不支持在查询中转换原始类型。请参阅Odata 查询字符串选项

但是,您可以编写一个服务操作来为您处理这个问题(假设您的查询提供程序支持这个)。

于 2016-02-02T12:47:03.447 回答