コード例 #1
0
ファイル: VoteViewModel.cs プロジェクト: yaoyel/Finework
 public virtual void AssignFrom(VoteEntity entity)
 { 
     if (entity == null) throw new ArgumentNullException(nameof(entity));
     this.Id = entity.Id;
     this.Subject = entity.Subject;
     this.TaskId = entity.Task.Id;
     this.Createor = entity.Creator.ToViewModel();
     this.StartAt = entity.StartAt;
     this.EndAt = entity.EndAt;
     this.CreatedAt = entity.CreatedAt;
     this.IsAnonEnabled = entity.IsAnonEnabled;
     this.IsMultiEnabled = entity.IsMultiEnabled;
     this.VoteOptions = entity.VoteOptions.Select(p => p.ToViewModel());
 }
コード例 #2
0
 public async Task UpdateVote(string city, DateTime date, Guid id, string nickname, VoteBll votingBll)
 {
     await this.tableTableStore.UpdateTableEntity(VoteEntity.FromVoteBll(city, date, id, nickname, votingBll));
 }
コード例 #3
0
        public async Task <bool> ContainsVote(string city, DateTime date, Guid id, string nickname)
        {
            List <VoteEntity> newsList = (await this.tableTableStore.ListTableEntityByPartitionKey <VoteEntity>(VoteEntity.BuildPartitionkey(city, date))).ToList();

            return(newsList.Any());
        }
コード例 #4
0
ファイル: VoteExistsResult.cs プロジェクト: yaoyel/Finework
 public VoteExistsResult(bool isSucceed, String message, VoteEntity vote)
     : base(isSucceed, message)
 {
     this.Vote = vote;
 }