TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Rich
NA
84
61.2k
Returning Complete Sequence
Jan 17 2012 1:32 PM
Below within my method I have the statement
nba_Team_Names nbaTeam = item.nba_Team_Names.FirstOrDefault();
This seems to return the first element or string in the sequence, but how do I return the entire sequence?
public void GetTeams()
{
IQueryable<Sports_Leagues_Level> team = from t in db.Sports_Leagues_Level
.Include("nba_Team_Names")
select t;
foreach (Sports_Leagues_Level item in team)
{
Console.WriteLine(item.ID);
nba_Team_Names nbaTeam = item.nba_Team_Names.FirstOrDefault();
if (nbaTeam != null)
{
Console.WriteLine(nbaTeam.Full_Name);
}
else
{
Console.WriteLine("No Nba Team");
}
}
}
Reply
Answers (
4
)
C# Linq Select Many
IQueryable question