Click here to Skip to main content
15,896,912 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Helló, please i need help in understanding relations in Modeling.
In my asp.net project, i have two class in my model namely profile and social.
Now, i want that if i go to profile page in my browser, i want both the details of the profile and the social to be displayed.
Another thing, why is it that when i use 'public virtual social social {get;set;}' in the profile class, it displays as a dropdownlist in profile view instead of the details. Please help me out here. Thank you for your understanding great programmers.
Posted

1 solution

 
Share this answer
 
Comments
[no name] 4-May-15 14:50pm    
Hello, please i want to edit my profile. With linq i can query the database to retrieve the profile details but when i click on edit, it simply gives an error. The url is displaying "profile/edit/1" but its like that pattern doesn't work since in my index i changed it to not return a list. Below, is what i have tried:
public ActionResult Index()
{
var spc = (from d in db.profiles.ToList()
where d.username == User.identity.Name
select new profile()
{name = d.name,
// other properties
});
return view(db.profile.ToList());
}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900