I am using EF code first in one of my mvc 3 projects. I have a question about what patterns to use when passing a complex EF POCO object to and from the views.
For example, a customer object has a list of orders and each order has a list of items. The customer object will be sent to the view. The view updates the customer object and its inside objects (orders, items), then send it back the controller. The controller have EF to persist the customer object.
My questions are following:
Should I serialize the EF poco object to a JSON object so I can use it inside the view?
How can I re-construct the customer object when I recieve updates from view?
After the customer object is reconstructed, Is it possible to save the entire object graph (customer, orders, items) in one shot?
Thanks