コード例 #1
0
 protected virtual void RemoveCore(TEntity entity)
 {
     try
     {
         DbSet.Remove(entity);
     }
     catch (DbEntityValidationException ex)
     {
         throw DbExceptionsConverter.Convert(ex);
     }
     catch (DbUpdateException ex)
     {
         throw DbExceptionsConverter.Convert(ex);
     }
 }
コード例 #2
0
 void IUnitOfWork.SaveChanges()
 {
     try
     {
         Context.SaveChanges();
     }
     catch (DbEntityValidationException ex)
     {
         throw DbExceptionsConverter.Convert(ex);
     }
     catch (DbUpdateException ex)
     {
         throw DbExceptionsConverter.Convert(ex);
     }
 }