public void Create(DalQuestion e) { if (e == null) { return; } var tmp = e.ToQuestion(); context.Set <Question>().Add(tmp); }
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; }