Guest User

Untitled

a guest
Mar 4th, 2014
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.66 KB | None | 0 0
  1.         public class BaseDoc
  2.         {
  3.             public string User;
  4.         }
  5.  
  6.         public class DocumentA: BaseDoc {}
  7.  
  8.         public class DocumentB: BaseDoc {}
  9.  
  10.         public class DocumentC: BaseDoc {}
  11.  
  12.         public class DocumentD: BaseDoc {}
  13.  
  14.         public class DocumentE: BaseDoc {}
  15.  
  16.         public class DocumentF: BaseDoc {}
  17.  
  18.         public class DocumentG: BaseDoc {}
  19.  
  20.         public class DocumentH: BaseDoc {}
  21.  
  22.         public class DocumentRepository<T> where T: BaseDoc
  23.         {
  24.             public List<T> documents;
  25.  
  26.             public DocumentRepository()
  27.             {
  28.                 documents = new List<T>();
  29.             }
  30.  
  31.             public IEnumerable<T> GetUserDocuments(string user)
  32.             {
  33.                 return documents.Where(x => x.User == user);
  34.             }
  35.         }
Advertisement
Add Comment
Please, Sign In to add comment