Hi there,
i'm trying to copy an entity real easy, but i get message "id is readonly"
this is my code.
TopicCollection tc = new TopicCollection();
IPredicateExpression filter = new PredicateExpression();
filter.Add(PredicateFactory.CompareValue(TopicFieldIndex.QuestionnaireId,
ComparisonOperator.Equal, oldQuestionnaireID));
tc.GetMulti(filter);
foreach (TopicEntity te in tc)
{
te.IsNew = true;
//remove old id
te.SetNewFieldValue((int)TopicFieldIndex.Id, null);
//update questionnaireID
te.QuestionnaireId = newQuestionnaireID;
}
tc.SaveMulti();
will this be possibleif a tweak soimething,
or do i really have to "copy" all fields into a new entity?
btw id is the primary-key
edit: it works as long i set only IsNew
however all the other fields are null, besides QuestionnaireID.
because i set it to, Isnew, the other fields are being emptied?