How To Get Data In An Sql Foreign Key Using Asp.net Entity Framework?
I'm now trying to incorporate relational database in my project. Before the implementation of rdbms in my project, normally i would normally be able to access my desired value thro
Solution 1:
If you have proper relationship between those two inside MusicStoreDBEntities, you should be able to access brand name like g.brand.name.
list2 = (from g in obj2.stringInstrumentItems
where g.brand.name == guitar select g).ToList();
^^^^^^
Otherwise, you will have to manually join them like this -
list2 = (from g in obj2.stringInstrumentItems
join b in obj2.brand
on g.brandId equals b.brandId
where b.name == guitar
select g).ToList();
Post a Comment for "How To Get Data In An Sql Foreign Key Using Asp.net Entity Framework?"