public void Delete(long id) { var entity = dataset.SingleOrDefault(e => e.Id == id); _context.Remove(entity); _context.SaveChanges(); }
public void Delete(long id) { var person = dataset.SingleOrDefault(p => p.Id == id); _context.Remove(person); _context.SaveChanges(); }
public void Delete(long Id) { var result = FindById(Id); if (result != null) { _context.Remove(result); _context.SaveChanges(); } }
public void Delete(long?id) { var result = _context.persons.SingleOrDefault(p => p.Id == id); if (result != null) { _context.Remove(result); _context.SaveChanges(); } }
public void Delete(long id) { var result = _context.Persons.SingleOrDefault(p => p.Id.Equals(id)); if (result != null) { try { _context.Remove(result); _context.SaveChanges(); } catch (Exception) { throw; } } }
public void Delete(long id) { var result = FindById(id); if (result != null) { try { _context.Remove(result); _context.SaveChanges(); } catch (Exception) { throw; } } }