c# - How do you retrieve records and all child records in one database hit in ADO.NET Entities? -


I want to call a database to retrieve the following data, but I am struggling to explain it That's what LINQ should do. Here's my current implementation (I know it's bad!):

  Include these photos = photos from photos. Join the entities in the photos tags. Photo gallery on photo. Photo gallery. Photo GalleryID is equal to PG Photo gallery id where pg Photo Gallery == Photo Gallery Choose IDID Photo; Var photoList = photos.ToList (); Forchach (various photo-forwarding in the photolist) {photoForLoading.UserReference.Load (); PhotoForLoading.PhotoComments.Load (); Forchha (PhotoForloading. Miscellaneous Commentary in Photo Comment) {comment.UserReference.Load (); }} Return picture list;  

So, as you can see above, I want to retrieve:

  • All photos from a specific photo gallery:
    • User details on each photo
    • Comment on each comment
      • User details on each comment

I ado How can I do LINQ with the framework of NET organizations?

Cheers, Ash

Include the method to load related institutions. For example: photos in organizations related to

  Photos. Include in ("User Reference"). Include in ("Photo Commands") etc ...  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -