Thanks for your reply but seems that I could not explain my issue properly. Actualy I am creating New Records/objects using ORM Classic API. Please refer following code for the objects in transient state required reference property to be filled.
// Order Master Object Created ////////
Order newOrder =
newOrder.OrderDate = DateTime.Now;
// Order Detail First Item Object Created ////////
newOrderDetail.ProductId = 1;
newOrderDetail.Qnty = 5;
// Order Detail Second Item Object Created ////////
newOrderDetail.ProductId = 2;
newOrderDetail.Qnty = 10;
We have Product as reference property in OrderDetail ..... and Product have property BalanceStock .
In our BO before saving, we need to verify all Orders Products are having Balance Stock...
Since this OrderDetail object is in transient state so we don't get Product Object filled under Orderdetail... this is null at this stage. so we cannot check Orderdetail.Product.BalanceStock > 1 rather we have to query Product table each time while iterating on Order.OrderDetails.
Is there any way I can get Order.OrderDetails .... (all child object's reference property Product) filled in one go/query within transient state.