0

if i know correct each Repository is on Entity
I have and ProductService then i need to get current product's images , there is not some repository for Images.
And my Product repositoy is responsible of product Entity.
Repository just return to us Entity objects because repositories should be unaware from DTO objects if i know correct.
So briefly How can i return Images entity. How should i get current selected product Images.

Between product and Images Foreign Key .

But product can have 10.000 Image row in database.

I need IQueryable data of them 10 by 10.

I tried Product.Images bla bla.. .but it didnt satisfied me.

Or should i create a new ImageRepository and inject it to Product service.

Then use it with filtered method which inside in BaseRepository.

How can i design it ?

MrCode
  • 35
  • 1
  • 1
  • 6

1 Answers1

0

Leave the product repository alone. You can change your service layer to accept interfaces instead of a BaseRepository. That interface could deal with either EF or some other type (not strictly EF\ORM repository). There are refactoring tools that can help with this by generating the interface from the existing BaseRepository (ex. ReSharper).

  • I leave alone product repository. Then put some custom methods to Base repository which implement Ibaserepository. But those functions have static entities. They are not generic. Because generic during run BaseRepository is Product entity becaseu it calling by Product service. There for i fixed it with static entities. Maybe somebodies have more good idea ! – MrCode Sep 04 '13 at 20:18