Guest User

ForumManager

a guest
Dec 27th, 2014
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.03 KB | None | 0 0
  1. namespace F.BL
  2. {
  3.     public class ForumManager : IForumManager
  4.     {
  5.         private IForumRepository repo;
  6.  
  7.         public ForumManager()
  8.         {
  9.             repo = new ForumRepository();
  10.         }
  11.  
  12.         public void Add<C>(C objectToAdd) where C : class
  13.         {
  14.             repo.Create<C>(objectToAdd);
  15.         }
  16.  
  17.         public IEnumerable<C> GetObjects<C>() where C : class
  18.         {
  19.             return repo.ReadObjects<C>();
  20.         }
  21.  
  22.         public C Get<C>(int objectId) where C : class
  23.         {
  24.             return repo.Read<C>(objectId);
  25.         }
  26.  
  27.         public void Remove<C>(int objectId) where C : class
  28.         {
  29.             repo.Delete<C>(objectId);
  30.         }
  31.  
  32.         public IEnumerable<D> GetXFromY<D, C>(int objectId) where C : class, IHasList<object>
  33.         {
  34.             return repo.ReadXFromY<D, C>(objectId);
  35.         }
  36.  
  37.         public C GetByName<C>(string objectName) where C : class, IHasUniqueName
  38.         {
  39.             return repo.ReadByName<C>(objectName);
  40.         }
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment