コード例 #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();
        }
コード例 #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();
        }
コード例 #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();
        }