Example #1
0
 public virtual void Update(T entity)
 {
     try
     {
         if (entity == null)
         {
             throw new ArgumentNullException("entity");
         }
         if (Context == null || _isDisposed)
         {
             Context = new PlayGround_DbContext();
         }
         SetEntryModified(entity);
         //Context.SaveChanges(); commented out call to SaveChanges as Context save changes will be called with Unit of work
     }
     catch (ValidationException dbEx)
     {
         throw new Exception(dbEx.Message, dbEx);
     }
 }
Example #2
0
 public EmployeeRepository(PlayGround_DbContext context)
     : base(context)
 {
 }
Example #3
0
 public GenericRepository(PlayGround_DbContext context)
 {
     _isDisposed = false;
     Context     = context;
 }