Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I create Asp.Net Mvc4 application with Code First EF. I create my model, and now I want get relational info from Database. I write get method for this info as follow:

public IQueryable<Invoice.Model.Invoice> Invoices 
{ 
     get 
       { 
         return context.Invoices.Include("InvoiceItems").Include("InvoiceStatus").Include("BankAccount").Include("TaxType").Include("Contract");
       } 
}

Then I use this properties in my operations, but relational info suach as InvoiceStatus return null,, How can fix this problem? Thanks in advance.

share|improve this question
When are you getting null values - when you convert the queryable to a list? Are foreign keys properly defined? – eightyeight 11 mins ago

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.