Coffeehouse Post

Single Post Permalink

View Thread: web api IEnumerable?
  • User profile image

    @FuncOfT: It would be preferable for regular APIs, but I don't think it really matters much in a WebApi. You don't know what's on the other end of the wire and have no control over what local data type they use in any event, so API design considerations here matter little. There's no difference in the resultant wire transfer, performance or functionality. The only reason to prefer IEnumerable<T> to an array would be if your underlying data wasn't an array to begin with... which we can't determine from the question.

    But yeah, IQueryable would be preferred.