Deep Secrets

Deep Secrets

  • 1.2k
  • 543
  • 6k

i Need Help Regarding Mvc Entity Framework

Feb 9 2019 12:57 PM
I have two Tables in my database one contains User List And Their information.
2nd contains the that submited by them
 
but these users are under some group
 
like this 
 
user15  works under  User1
user16 works under User1
 
var t = db.Users.Where(u => u.Under_Control == Undr).Select(u => u.UserName).ToList();
 
gives me the list of users
then i am trying to to retrieve  data from 2nd table by using loop
eg
foreach(var item in db.userdata) {
create new list of all data... 
}
 i am failed then i tried this way
 
 
var test = (from usr in db.Users from data in db.userdata where user.Under_Control==Undr select data).ToList():
 
 
but it is giving me 1*5 list 
 
Please help me to solve this i am new to Asp.net 
 
 

Answers (2)