예제 #1
0
        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();
        }
예제 #2
0
        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();
        }
예제 #4
0
        public void Delete(int id)
        {
            var stock = new Stock {
                Id = id
            };

            _context.Remove(stock);
            _context.SaveChanges();
        }
예제 #5
0
        public void Delete(int id)
        {
            var greenBlend = new GreenBlend {
                Id = id
            };

            _context.Remove(greenBlend);
            _context.SaveChanges();
        }
예제 #6
0
        public void Delete(int id)
        {
            var contact = new Contact {
                Id = id
            };

            _context.Remove(contact);
            _context.SaveChanges();
        }