My goal is to set default values on the OrderEntity when ever a new one is made during databinding's AddNew() and added to it's collection.
Structure:
I have an EntityCollection<Customer> called "Customers" and each CustomerEntity has an EntityCollection<Order> "Orders" filled in via an Adapter from a Linq Query using the Execute() command.
How do I catch the event 'EntityAdding' on the orders collection so I can modify the OrderEntity before it goes into the Orders collection?
There is no Customer.Orders like in the SelfServicing model, so I'm not sure where to get it from.
I created an OrderCollection class, but am not sure how to get the adapter when it fills the Customers to use that instead of EntityCollection<OrderEntity>
public class Orders: EntityCollection<OrderEntity>
{
protected override bool OnEntityAdding(OrderEntityentityToAdd)
{
return base.OnEntityAdding(entityToAdd);
}
}