What interface should my service return? IQueryable, IList, IEnumerable?

后端 未结 7 2220
孤独总比滥情好
孤独总比滥情好 2021-01-31 23:26

Imagine I have a SearchService layer that has a method to search all cars starting with a certain string;

public static class Searcher{
    public IAnInterface&l         


        
7条回答
  •  终归单人心
    2021-01-31 23:53

    If you are using IQueryable as return type, You have a service layer with leaky abstraction.

提交回复
热议问题