Пример #1
0
        public void Create(DalQuestion e)
        {
            if (e == null)
            {
                return;
            }
            var tmp = e.ToQuestion();

            context.Set <Question>().Add(tmp);
        }
Пример #2
0
        public void Update(DalQuestion entity)
        {
            var tmp = context.Set <Question>().SingleOrDefault(t => t.Id == entity.Id);

            if (tmp != null)
            {
                return;
            }
            tmp = entity.ToQuestion();
            context.Entry(tmp).State = EntityState.Modified;
        }