コード例 #1
0
        public async Task <Models.Database.VoteSelfRegistration> CreateVoterRegistration(Models.Database.VoteSelfRegistration voteRegistration)
        {
            Exceptions.TestForNull(voteRegistration, nameof(voteRegistration));

            voteRegistration = await voteRegistrationDB.CreateRegistration(voteRegistration);

            _cacheOperation.Delete(cacheKey);
            return(voteRegistration);
        }
コード例 #2
0
        public async Task <Models.Database.VoteCandidate> CreateCandidate(Models.Database.VoteCandidate candidate)
        {
            Exceptions.TestForNull(candidate, nameof(candidate));

            candidate = await voteCandidateDB.SaveCandidate(candidate);

            var cacheKey = "VoteCandidates";

            _cacheOperation.Delete(cacheKey);
            return(candidate);
        }
コード例 #3
0
        public async Task <Models.VoterTalley> InsertVoterTally(Models.VoterTalley voterTalley)
        {
            Exceptions.TestForNull(voterTalley, nameof(voterTalley));

            var dbVoterTally = new Models.Database.VoterTally()
            {
                IsDeleted              = voterTalley.IsDeleted,
                Createdon              = DateTime.Now,
                VoteCandidateId        = voterTalley.VoteCandidate.Id,
                VoteSelfRegistrationId = voterTalley.VoteSelfRegistration.Id
            };

            dbVoterTally = await voterTallyDB.InsertTally(dbVoterTally);

            _cacheOperation.Delete(cacheKey);
            voterTalley.Id = dbVoterTally.Id;
            return(voterTalley);
        }
コード例 #4
0
 public async Task <Boolean> UpdateFlag(Boolean input)
 {
     _cacheOperation.Delete(cacheKey);
     _cacheOperation.Save(input, cacheKey, 10, Services.Cache.Models.TimeUnit.Hours);
     return(input);
 }