Is this Repository pattern efficient with LINQ-to-SQL?

后端 未结 4 757
无人共我
无人共我 2020-12-09 07:20

I\'m currently reading the book Pro Asp.Net MVC Framework. In the book, the author suggests using a repository pattern similar to the following.

[Table(Name         


        
4条回答
  •  一整个雨季
    2020-12-09 07:53

    Yes linq2sql will generate magic to make it more efficient. It depends on you using the IQueryable interface. If you want to check clamp the SQL profiler on and you can see it generate the appropriate query.

    I would recommend introducing a service layer to abstract away your dependancy on linq2sql.

提交回复
热议问题