public void UpdateInstance(AnswerInstance instance) { var ctx = QuizlrContext.Current; ctx.AnswerInstances.Attach(instance); ctx.Entry(instance).State = EntityState.Modified; ctx.SaveChanges(); }
public AnswerInstance CreateInstance(AnswerInstance instance) { var ctx = QuizlrContext.Current; ctx.AnswerInstances.Add(instance); ctx.SaveChanges(); return instance; }
public void DeleteInstance(AnswerInstance instance) { var ctx = QuizlrContext.Current; ctx.AnswerInstances.Remove(instance); ctx.SaveChanges(); }