The GetAllProducts method returns the entire list of products as an IEnumerable type.
该控制器定义了三个方法,它们或者返回一个单一产品,或一个产品列表。
We say "partially" because there are several scenarios where one would like to use an interface with a richer API than IEnumerable.
我们之所以说“部分”,是因为在某些情况下,人们应一次性地使用某个具有丰富api的接口,而不是使用IEnumerable接口。
However, for those scenarios we already encourage people to just take an IEnumerable and special case having the instance implementing ICollection too.
然而,在这些场景下,我们已鼓励人们仅采用IEnumerable接口,而且对于拥有实现了ICollection接口的实例的特殊情况也是如此。
应用推荐