public bool DeletePlayerMatches(Match match)
 {
     var playerMatchesToDelete = context.PlayerMatches.Where(x => x.MatchID == match.MatchID);
     context.PlayerMatches.RemoveRange(playerMatchesToDelete);
     Save();
     return true;
 }
        public bool DeleteMatch(Match match)
        {
            bool playerMatchesDeleted = playerMatchRepository.DeletePlayerMatches(match);
            bool matchDeleted = matchRepository.DeleteMatch(match);

            return (playerMatchesDeleted && matchDeleted);
        }
 public Match InsertMatch(Match match)
 {
     return new Match
     {
         MatchID = 1,
         MatchDate = DateTime.Today
     };
 }
 public ButtonViewModel(IFootballRepository footballRepository, IPlayerMatchViewModel playerMatchViewModel, IMatchValidatorService matchValidatorService, IMailerService mailerService)
 {
     _footballRepository = footballRepository;
     _playerMatchViewModel = playerMatchViewModel;
     _matchValidatorService = matchValidatorService;
     _matchValidatorService.PlayerMatches = _playerMatchViewModel.PlayerMatches;
     _selectedMatch = new Match();
     _mailerService = mailerService;
     _canExecute = true;
 }
 public bool DeletePlayerMatches(Match match)
 {
     return true;
 }
 public bool DeleteMatch(Match match)
 {
     return true;
 }
 public bool DeletePlayerMatches(Match match)
 {
     return playerMatchRepository.DeletePlayerMatches(match);
 }
 public Match InsertMatch(Match match)
 {
     return matchRepository.InsertMatch(match);
 }
Пример #9
0
 public static Match GetNewSubsequentMatch(this Match match)
 {
     Match newMatch = new Match();
     newMatch.MatchDate = match.MatchDate.Value.AddDays(7);
     return newMatch;
 }
Пример #10
0
 public void UpdateMatch(Match match)
 {
     context.Entry(match).State = EntityState.Modified;
 }
Пример #11
0
 public Match InsertMatch(Match match)
 {
     context.Matches.Add(match);
     Save();
     return match;
 }
Пример #12
0
 public bool DeleteMatch(Match match)
 {
     context.Matches.Remove(match);
     Save();
     return true;
 }