I am having a problem updating with the generated code. Here is how I am performing the update which should work. The only thing I do differently that what is in the documentation is use getmulti since this is a legacy database and no primary key is defined.
Any help is appreciated.
WarheaderCollection wc = new WarheaderCollection();
RelationCollection r = new RelationCollection();
PredicateExpression pe = new PredicateExpression();
pe.Add( PredicateFactory.CompareValue( WarheaderFieldIndex.Warnum, ComparisonOperator.Equal, contractIn.ContractNumber ) );
DbUtils.CommandTimeOut = 360;
WarheaderEntity wh = new WarheaderEntity();
//WardetailEntity wd = new WardetailEntity();
Transaction t = new Transaction( System.Data.IsolationLevel.Serializable, "datainsert" );
try
{
if( !wc.GetMulti( pe, r ) )
{
throw new Exception( "Parent contract record does not exist." );
}
wh = wc[0];
wh.Custfirst = contractIn.Customer.Firstname;
t.Add( wh );
wh.Save();