コード例 #1
0
        public void SaveLotteryNumbers(LotteryNumber lotteryNumber)
        {
            if (lotteryNumber.LotteryNumberId == 0)
            {
                context.LotteryNumbers.Add(lotteryNumber);
            }
            else
            {
                var dbEntry = context.LotteryNumbers.Find(lotteryNumber.LotteryNumberId);
                if (dbEntry != null)
                {
                    dbEntry.MatchNumbers = lotteryNumber.MatchNumbers;
                    dbEntry.FinalNumbers = lotteryNumber.FinalNumbers;
                }
            }

            context.SaveChanges();
        }
コード例 #2
0
 public bool CheckDuplicateTicket(long ticketId,
                                  bool isForApproval, LotteryNumber lotteryNumber = null) =>
 DataAccess.CheckDuplicateTicket(ticketId, isForApproval, lotteryNumber);