Commit före flytt avStatusparameter från point till round
This commit is contained in:
36
GreadyPoang.DataLayer/DataClasses/CombinedRepository.cs
Normal file
36
GreadyPoang.DataLayer/DataClasses/CombinedRepository.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using GreadyPoang.DataLayer.Database;
|
||||
using GreadyPoang.EntityLayer;
|
||||
|
||||
namespace GreadyPoang.DataLayer;
|
||||
|
||||
public class CombinedRepository : ICombinedRepository
|
||||
{
|
||||
private readonly DataContext _context;
|
||||
|
||||
public CombinedRepository(DataContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
|
||||
IEnumerable<RoundBuilderElement> ICombinedRepository.roundBuilderElements()
|
||||
{
|
||||
var result = (from gameRound in _context.GameRounds
|
||||
join gamePoint in _context.GamePoints on gameRound.GameRoundId equals gamePoint.GameRoundId
|
||||
join participant in _context.Participants on gamePoint.ParticipantId equals participant.ParticipantId
|
||||
orderby gameRound.GameRoundStartDate descending, participant.LastName, participant.FirstName, gamePoint.GameRoundRegNr
|
||||
select new RoundBuilderElement
|
||||
{
|
||||
ParticipantId = participant.ParticipantId,
|
||||
ParticipantName = participant.LastNameFirstName,
|
||||
GamePointId = gamePoint.GamePointId,
|
||||
GameRoundRegNr = gameRound.GameRoundId,
|
||||
GameRegPoints = gamePoint.GameRegPoints,
|
||||
GameRoundId = gameRound.GameRoundId,
|
||||
GameRoundStartDate = gameRound.GameRoundStartDate,
|
||||
Status = gamePoint.PointStatus
|
||||
}).ToList();
|
||||
return result;
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user