views:

42

answers:

1

I am trying to do something where if have a two classes (that i care about) one called Inquiries and the other is a foreign Key Table of InquiryStatus

What my business logic I am trying to check if the Inquiry gets tied to a new InquiryStatus which would have InquiryStatus.bln_requiresValue then I need to have an Inquiry.Money

Right now i have

public partial class Inquiry
{
    partial void OnInquiryIdChanging(int value)
    {
        if (EntityState == System.Data.EntityState.Added)
        {
              var Ekey = InquiryStatusReference.Value;
        }
    }
}

But Ekey is always null so is InquiryStatusReference.EntityKey

A: 

Did you try InquiryStatusReference.Load() before assigning Ekey?

NVRAM