Hi,
LinqPad 5, LLBLGen v.5.6x
Noticed that if I do:
var e = new XYZ();
e.Fields[(int)XYZFieldIndex.DateValidFrom].SetExpression(GetUtcDateTimeOffset());
this.AdapterToUse.SaveEntity(e).Dump("isSaveOk");
where
GetUtcDateTimeOffset()
is
public static DbFunctionCall GetUtcDateTimeOffset()
{
return new DbFunctionCall("SYSDATETIMEOFFSET", null);
}
then it prints true, but no actual query is executed. Seems like .SetExpression is not triggering entity to be "dirty", to fix this I either have to set some other property to some value then .SetExpression starts working or explicitly mark that field as changed:
e.Fields[(int)XYZFieldIndex.DateValidFrom].IsChanged = true;
Is it by design that it:
if some other property is modified then .SetExpression field(s) don't need explicit
.IsChange = true
if only .SetExpression is used, then it requires explicit
.IsChange = true
or for entity
e.IsDirty = true
Thank you!