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); }
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); }
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); }
public async Task <Boolean> UpdateFlag(Boolean input) { _cacheOperation.Delete(cacheKey); _cacheOperation.Save(input, cacheKey, 10, Services.Cache.Models.TimeUnit.Hours); return(input); }