Could you help me please to minimize response of my Web API Route.
public class Product
{
public string UniqueId {get;set;}
public string Title {get;set;}
...
}
public class ProductsController : ApiController
{
public IEnumerable<Product> GetAllProducts()
{
return repository.GetAll();
}
// ....
}
The response contains full names of the entity properties:
[{
UniqueId: 123,
Title: 'Book 1'
},...]
I would like to minimize traffic by using short aliases for DTO properties and see something like this:
[{
u: 123,
t: 'Book 1'
},...]
I'm wondering if special attributes could be used to rename properties in request/response. BTW I'm talking about requests because I have the same issue for POST requests.