public string DeleteGroup(int Id) { try { using (dbContext) { var group = dbContext.Groups.Find(Id); dbContext.Remove(group); dbContext.SaveChanges(); return("Deleted Successfully !"); } } catch (Exception ex) { return(ex.Message.ToString()); } }
public string RemoveCustomerAddress(int Id) { try { using (dbContext) { var delivery = dbContext.Deliveries.Find(Id); if (delivery != null) { dbContext.Remove(delivery); dbContext.SaveChanges(); } return("Seccusfully Removed !"); } } catch (Exception ex) { return(ex.Message.ToString()); } }