Advertisement
Guest User

Untitled

a guest
Mar 20th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.84 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Threading;
  4. using System.IO;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace IMJunior
  9. {
  10.     class User
  11.     {
  12.  
  13.     }
  14.  
  15.     public class Program
  16.     {
  17.         static void Main()
  18.         {
  19.             Repository<User> users = new Repository<User>();
  20.             users.GetAll();
  21.  
  22.             UserRepository repo = new UserRepository();
  23.         }
  24.     }
  25.  
  26.     public class Repository<T>
  27.     {
  28.         private T[] _data;
  29.  
  30.         public T GetById(int id)
  31.         {
  32.             return _data[id];
  33.         }
  34.  
  35.         public T[] GetAll()
  36.         {
  37.             return _data;
  38.         }
  39.     }
  40.  
  41.     class UserRepository : Repository<User>
  42.     {
  43.         public User GetByName()
  44.         {
  45.             throw new NotImplementedException();
  46.         }
  47.     }
  48.  
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement