tag:blogger.com,1999:blog-2889416825250254881.post501256650167020422..comments2024-01-27T11:41:32.146+00:00Comments on Byte Rot: Using range header for retrieving range of IEnumerable in ASP.NET Web APIaliostadhttp://www.blogger.com/profile/05695786967974402749noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-2889416825250254881.post-76938235004684796502012-08-15T13:10:08.524+01:002012-08-15T13:10:08.524+01:00Yeah it is here:
http://www.w3.org/Protocols/rfc2...Yeah it is here:<br /><br />http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.16aliostadhttps://www.blogger.com/profile/05695786967974402749noreply@blogger.comtag:blogger.com,1999:blog-2889416825250254881.post-53147799127607895932012-08-15T13:02:37.628+01:002012-08-15T13:02:37.628+01:00The reason for the custom type is to bundle proper...The reason for the custom type is to bundle properties like Total and set them in the header, plus with using the custom type you can see that my intent is to return a page of data. That and it allowed me to easily pick up when to respond with the headers.<br /><br />Do you have a link to that part of the spec?<br /><br />Cheers<br />TonyTWith2Sugarshttps://www.blogger.com/profile/15887500048552207996noreply@blogger.comtag:blogger.com,1999:blog-2889416825250254881.post-28166734973002332532012-08-07T12:08:53.411+01:002012-08-07T12:08:53.411+01:00Well, IMHO, you really do not need another type (t...Well, IMHO, you really do not need another type (that would be intrusive) and also the count should be on the Content-Range according to HTTP spec.aliostadhttps://www.blogger.com/profile/05695786967974402749noreply@blogger.comtag:blogger.com,1999:blog-2889416825250254881.post-50241014370511124082012-08-07T11:10:24.276+01:002012-08-07T11:10:24.276+01:00I recent wrote a very similar post to this a few d...I recent wrote a very <a href="http://blog.tonywilliams.me.uk/thoughts-on-resthateoas-collections-and-the-range-header/" rel="nofollow">similar post</a> to this a few days before you <br /><br />Although I didn't include any specific implementations I have built a working example (I'll have to blog about that soon) in which instead of returning IEnumerable I return a custom type "IPagedList<>" which inherits IEnumerable but includes properties like an option count etc.<br /><br />I then have a custom delegation handler to detect when the WebApi returns IPagedList and modify the response code/headers instead of using an attribute.<br /><br />Good post!TWith2Sugarshttps://www.blogger.com/profile/15887500048552207996noreply@blogger.com