示例#1
0
 public void Delete(Mortes mortes)
 {
     try
     {
         if (mortes != null)
         {
             _context.Remove(mortes);
             _context.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
示例#2
0
 public void Add(Mortes mortes)
 {
     try
     {
         if (mortes != null)
         {
             if (mortes.Id == 0)
             {
                 _context.Add(mortes);
                 _context.SaveChanges();
             }
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }