public void Delete(int id) { var roast = _context.Roasts.Include(x => x.Beans).Include(x => x.CuppingInfo).FirstOrDefault(x => x.Id == id); if (roast.Beans != null) { roast.Beans.ForEach(x => _context.GreenBlends.Remove(x)); } if (roast.CuppingInfo != null) { _context.Remove(roast.CuppingInfo); } _context.Remove(roast); _context.SaveChanges(); }
public void Delete(int id) { var cupping = new Cupping { Id = id }; _context.Remove(cupping); _context.SaveChanges(); }
public void Delete(int id) { var greenBeanInfo = new GreenBeanInfo { Id = id }; _context.Remove(greenBeanInfo); _context.SaveChanges(); }
public void Delete(int id) { var stock = new Stock { Id = id }; _context.Remove(stock); _context.SaveChanges(); }
public void Delete(int id) { var greenBlend = new GreenBlend { Id = id }; _context.Remove(greenBlend); _context.SaveChanges(); }
public void Delete(int id) { var contact = new Contact { Id = id }; _context.Remove(contact); _context.SaveChanges(); }