I have the following code:
foreach (Question question in upd)
{
if (question.AssignedTo == null)
{
question.QuestionStatusId = 6;
}
else
{
question.AssignedDate = DateTime.UtcNow;
question.QuestionStatusId = 5;
}
_uow.Questions.Update(question);
}
Where upd is a List
It works but I am wondering if there is a simpler way for me to code this. Before I was using the following:
upd.ForEach(_obj => _uow.Questions.Update(_obj));
However now I cannot do like this as I have some code that must run before each update.