public static ResultDto AssembleMatchHomeScore(this Com.BinaryBracket.BowlsResults.Competition.Domain.Entities.Match.Match match) { var dto = new ResultDto(); dto.ResultType = match.HomeResultTypeID.Value; dto.GameScore = match.HomeGameScore.Value; dto.ChalkScore = match.HomeChalkScore.Value; dto.BonusScore = match.HomeBonusScore; dto.ChalkHandicap = match.HomeChalkHandicap; dto.IsWalkover = match.HomeWalkover.Value; return(dto); }
public static BaseMatchDto AssembleDto(this Com.BinaryBracket.BowlsResults.Competition.Domain.Entities.Match.Match match) { if (match is PlayerMatch playerMatch) { return(AssemblePlayerMatchDto(playerMatch)); } if (match is TeamMatch teamMatch) { return(AssembleTeamMatchDto(teamMatch)); } throw new NotImplementedException("Only Player Dto Supported"); }