Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

ASP.NET 5 Please help - many-to-many relatnionship

$
0
0

Hi!

In ASP.NET you still cannot migrate many-to-many relationship. So I created a join class link. I have an ApplicationUser class, a CloudMusic and the UserCloudMusic join class. I cannot collect the logged in user's musics to an IEnumerable. Until I was using one user - many musics I had no problems. This was my code: 

 IEnumerable<CloudMusic> cmList = _context.CloudMusic.ToList().Where(p => p.ApplicationUser == appUser); 


But know I cannot create this list. Always will have 0 elements:

 IEnumerable<CloudMusic> cmList = _context.CloudMusic.ToList().Where(p => p.UserCloudMusics == appUser);

Please show me, how to select the user's musics.

Thanks!


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>