public void Update(ModelsEntity Models)
        {
            var existing = _models.FindOne(u => u.Id == Models.Id);

            if (existing == null)
            {
                throw new System.Exception("No models found to update");
            }

            _models.UpdateOne(Models);
        }
Beispiel #2
0
        public void Update(TemplateEntity Template)
        {
            var existing = _Templates.FindOne(u => u.Id == Template.Id);

            if (existing == null)
            {
                throw new System.Exception("No template found to update");
            }

            _Templates.UpdateOne(Template);
        }
Beispiel #3
0
        public void Update(User user)
        {
            var existing  = _users.FindOne(u => u.Username == user.Username);
            var duplicate = _users.FindOne(u => u.Email == user.Email);

            if (existing == null)
            {
                throw new Exception($"No user exists to update");
            }

            _users.UpdateOne(user);
        }