Hi guys,

As title says im using EF5 legacy

Im just wondering if it is possable and not overly complicated to 'catch' when an object is being added to another object.
So i have a Car table/object and an Order table/object, im looking for something like the onpropertychanged when i add an order to the car is it possable to catch this event, im looking to perform some business logic i think it would be called.

Currently I am using my orderstatus property and carstatus property changing to manage these but i think there is a better way of doing it, im worried that for some reason the order wasn't saved correctly to the car that it would start to give me wrong totals and wrong status and i feel the best time to change the status and change the money side of things are when the order is actually added to the car. If this is something rather complicated then i might just leave it as my programming skills/knowledge i would consider are rather limited.

Code:
If Me.Car.Orders.Count = 1 Then
                Select Case Me._Order_Status
                    Case OrderStatus.ToBeInvoiced
                        Me.Car.Car_Status = Car_Status.ToBeInvoiced
                    Case OrderStatus.Invoiced
                        Me.Car.Car_Status = Car_Status.Invoiced_AwaitingPayment
                    Case OrderStatus.Paid
                        Me.Car.Car_Status = Car_Status.FullyPaid
                End Select


            ElseIf Me.car.Orders.Count > 1 Then
               Dim Status As New List(Of Int16)


                For Each Order In Me.Car.Orders
                    Status.Add(Order.Order_Status)
                Next


                Status.Reverse()


                Select Case CType(Status.First, OrderStatus)
                    Case OrderStatus.ToBeInvoiced
                        Me.Car.Car_Status = Car_Status.ToBeInvoiced
                    Case OrderStatus.Invoiced
                        Me.Car.Car_Status = Car_Status.Invoiced_AwaitingPayment
                    Case OrderStatus.Paid
                        Me.Car.Car_Status = Car_Status.FullyPaid
                End Select
            End If


    Public Sub ForceTotals()
        Dim _Due As New Integer
        Dim _Paid As New Integer
        Dim _Total As New Integer


        For Each order As Order In Me.Orders
            If order.Order_Status = OrderStatus.Paid Then
                _Paid += order.Order_Amount
            Else
                _Due += order.Order_Amount
            End If
            _Total += order.Order_Amount
        Next


        Me.Car_AmountDue = _Due
        Me.Car_AmountPaid = _Paid
        Me.Car_AmountTotal = _Total
    End Sub
This is an example of how I am doing this, slightly off topic but when im chekcing my cars for its orders because most cars will have 1 order and a few will have more than one.
Is it more efficient to check the Orders.Count and execute the code in blue or just execute the code in red regardless of only 1 order.