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
Marius Vasile
594
1.9k
144.7k
asp.net core ef count rows containing a specific data
Mar 19 2021 6:21 AM
I am trying to get data for a chart using
var getData = await _context.WOMains.Where(s => s.OrgID == orgid).Select(s => s.WOType).ToListAsync();
foreach (var item in getData)
{
WOMainChart = getData.Select(a =>
new
WOChart
{
ChartData = item,
ChartValue = item.Count()
}).ToList();
}
In the table I have three disting WOType, each added only one time, so 3 rows in total. However, when I run the query I get 22 as a count for each. What am I doing wrong?
Reply
Answers (
4
)
how to decrease time of long running method in c#(windows form)
why using task async in asp c#