Hi krishna,
You can do something like this
LogEntity newLog = new LogEntity();
newLog.Name = "XXX";
StationEntity newStation = new StationEntity();
newStation.StationID = "123";
// this allows the PK-FK sync,
//so when you save newLog, the just autogenerated LogId will be asigned to newStation.LogId
newLog.Stations.Add(newStation);
// if you are using Adapter templateSet
using (DataAccessAdapter adpater = new DataAccessAdapter())
{
// will save recursive, and will refetch the newest values
adapter.SaveEntity(newLog, true, true);
}
// if you are using SelfServicing templateSet
// will save recursive, and will refetch the newest values (that is the nature of SelfServicing)
newLog.Save(true);