我有一组答案 ( IList<Answer>
) 和两个表(答案和答案历史)。我想做一些类似的事情:
Get the current answers from db.
save(Answers, "AnswerHist");
delete(Answers, "Answer");
Answers = questions
.Select(x => new Answer(response)
{
QuestionID = x.QuestionID,
Value = x.Answer.Value,
Bool = x.Answer.Bool,
Date = x.Answer.Date,
Number = x.Answer.Number,
Text = x.Answer.Text
})
.ToList<Answer>();
保存(答案,“答案”);
基本上,将答案保存到历史表中,从答案表中删除答案,然后更新答案并将它们插入到答案表中。
有什么简单的方法可以让休眠保存同一个类和多个相同的表?