Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Edited Unassigned: $select response on Json formatter not maintaning the order of properties mentioned in the $select query. [1049]

$
0
0
I checked with OData formatter and there the order is maintained as expected.

Request(note the order of properties):
http://localhost:63523/api/Categories?$top=3&$select=Description,CategoryName

Response:
[{"CategoryName":"Beverages","Description":"Soft drinks, coffees, teas, beers, and ales"},{"CategoryName":"Condiments","Description":"Sweet and savory sauces, relishes, spreads, and seasonings"},{"CategoryName":"Confections","Description":"Desserts, candies, and sweet breads"}]

I have the following model for Category(from Northwind):
```
namespace SampleWebApiApp.Models
{
using System;
using System.Collections.Generic;

public partial class Category
{
public Category()
{
this.Products = new HashSet<Product>();
}

public int CategoryID { get; set; }
public string CategoryName { get; set; }
public string Description { get; set; }
public byte[] Picture { get; set; }

public virtual ICollection<Product> Products { get; set; }
}
}
```

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>