Ejemplo n.º 1
0
        //delete the selected abiotiek multi of the selected plant (Liam)
        public void DeleteAbioticMulti(AbiotiekMulti abioticMulti)
        {
            var selectedAbioticMulti = _context.AbiotiekMulti.FirstOrDefault(s => s.Id == abioticMulti.Id);

            _context.AbiotiekMulti.Remove(selectedAbioticMulti);

            _context.SaveChanges();
        }
Ejemplo n.º 2
0
        //edit the selected abiotiek multi of the selected plant (Liam)

        public void ChangeAbioticMulti(AbiotiekMulti abioticMulti, string property, string value)
        {
            var selectedAbiotickMulti = _context.AbiotiekMulti.FirstOrDefault(s => s.Id == abioticMulti.Id);

            selectedAbiotickMulti.Eigenschap = property ?? selectedAbiotickMulti.Eigenschap;
            selectedAbiotickMulti.Waarde     = value ?? selectedAbiotickMulti.Waarde;

            _context.SaveChanges();
        }
Ejemplo n.º 3
0
        //add a abioMulti to the current plant (Liam)
        public void AddAbioticMulti(Plant plant, string property, string value)
        {
            AbiotiekMulti abioticMulti = new AbiotiekMulti
            {
                PlantId    = plant.PlantId,
                Eigenschap = property,
                Waarde     = value
            };

            _context.Add(abioticMulti);

            _context.SaveChanges();
        }