c# - how to query multiple table using linq -
i new linq , got stuck in scenario is, have "student" table id(pk) , name, , "address" table id(pk), address, studid(fk), city , city table city id(pk) , city name. student can have multiple addresses in "address" table, want result of student multiple city(should array) name 1 of property of student entity. in student object id,name,address,city[](array of cities).
student.addresses = address.where(x => x.studid == student.id).tolist();
this more or less want do, query address table match on student id can cycle through addresses , pick out cities, give more information.
Comments
Post a Comment