DB Result Set and Model Result Sets Different | Rows Duplicating

Adrian N 81 Reputation points
2022-08-18T04:48:12.387+00:00

Hey Everyone

Just wondering if I can get some help with something. I created an application where people can sign up for a competition. Basically the user can enter their team details, such as Team Name and the Players the are involved.

The application has the ability to view the list of players that have sign up for the competition, where it displays the Team Name and players that are involved.
When I do an SQL Query on the database, the results are fine and shows the correct information. However when I do the same from the app, the rows are for some reason duplicated.

I've attached the images from the db and the application.

DB Result set from: SELECT * FROM [dbo].[CompetitionBookingParticipant_View] WHERE CompetitionId='4b0f9684-1ac6-484a-9fe2-c02ecd098ac2';
232193-image.png

View that I receive when asking for the same information.
Query: List<CompetitionBookingParticipant_View> participantsList = await _context.CompetitionBookingParticipant_View.Where(booking => booking.CompetitionId == competition.Id).OrderBy(booking => booking.Division).ThenBy(booking => booking.TeamName).ThenBy(booking => booking.Name).ToListAsync();

232179-image.png

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,124 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,237 questions
{count} votes