Exemplo n.º 1
0
 public void Delete(int id)
 {
     try
     {
         _dbContext.Remove(_dbContext.Parcels.Single(x => x.ID == id));
         _dbContext.SaveChanges();
     }
     catch (SqlException exc)
     {
         throw new DALException($"{exc.GetType()} Exception in {System.Reflection.MethodBase.GetCurrentMethod().Name}", exc);
     }
 }
Exemplo n.º 2
0
 public void Delete(string code)
 {
     try
     {
         _dbContext.Remove(_dbContext.Hops.Single(x => x.Code == code));
         _dbContext.SaveChanges();
     }
     catch (SqlException exc)
     {
         throw new DALException($"{exc.GetType()} Exception in {System.Reflection.MethodBase.GetCurrentMethod().Name}", exc);
     }
     catch (Exception exc)
     {
         throw new DALException($"{exc.GetType()} Exception in {System.Reflection.MethodBase.GetCurrentMethod().Name}", exc);
     }
 }