Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.28 KB | None | 0 0
  1. interface ProductsProvider<T> where T: IProduct
  2. {
  3.     T GetById(long id)
  4. }
  5.  
  6. class MyProduct : IEntityBase
  7. {
  8.    ctor(ProductsProvider<MyProduct> provider)
  9.    {
  10.     this.provider = provider;
  11.    }
  12.  
  13.    MyProduct GetById()
  14.    {
  15.         this.Provider.GetById(id)
  16.    }
  17.    ...
  18.    ...
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement