Ejemplo n.º 1
0
        public static topic DeleteTopic(string topic_name)
        {
            topic old_value = GetTopic(topic_name);

            using (MyModel db = new MyModel())
            {
                var result = from _topic in db.topics
                             where _topic.topic1 == topic_name
                             select _topic;

                db.topics.Remove(result.First());
                db.SaveChanges();
                return(old_value);
            }
        }
Ejemplo n.º 2
0
        public static topic EditTopic(topic _new_value)
        {
            topic old_value = GetTopic(_new_value.topic1);

            using (MyModel db = new MyModel())
            {
                var result = from _topic in db.topics
                             where _topic.topic1 == _new_value.topic1
                             select _topic;

                topic cur_topic = result.First();

                cur_topic.words = _new_value.words;
                db.SaveChanges();
                return(old_value);
            }
        }