0

I have this Error

use casting ('t => ((Derived)t).MyProperty') or the 'as' operator ('t => (t as Derived).MyProperty'). Collection navigation access can be filtered by composing Where, OrderBy(Descending), ThenBy(Descending), Skip or Take operations. For more information on including related data, see http://go.microsoft.com/fwlink/?LinkID=746393.'

this my code

enter image description here

enter image description here

enter image description here

i want get Employee name

this path on the images

TBEmployeePc > TBEmployee > EmployeeName (i want get this "EmployeeName")

any ideas

1
  • 1
    Please do not post code and errors as images. Commented Jan 7, 2024 at 21:41

1 Answer 1

0

TBEmployeePc > TBEmployee > EmployeeName (i want get this "EmployeeName")

Try:

var pc=Octx.TBEmployeePc.Include(x=>x.TBEmployee).ToList();
var namelist = pc.Select(o => o.TBEmployee.Select(c => c.EmployeeName)).ToList();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.