Exemplo n.º 1
0
        public async Task <PlayerHistoryEntity> GetByIDAsync(int playerHistoryID)
        {
            List <PlayerHistoryEntity> historyEntities = await GetAsync();

            PlayerHistoryEntity historyEntity = historyEntities?.SingleOrDefault(h => h.PlayerHistoryID == playerHistoryID);

            return(historyEntity);
        }
Exemplo n.º 2
0
        public async Task UpdatePlayerHistory(PlayerHistoryBE historyBE)
        {
            PlayerHistoryEntity historyEntity = base.Mapper.Map <PlayerHistoryEntity>(historyBE);

            historyEntity.LastModifiedBy       = SystemConstants.DefaultUser;
            historyEntity.LastModifiedDateTime = DateTime.UtcNow;

            await base.DataSvc.PlayerHistoryRepo.UpdateAsync(historyEntity);
        }
Exemplo n.º 3
0
        public async Task <bool> InsertAsync(PlayerHistoryEntity entity)
        {
            PlayerHistoryEntity lastHistory = (await GetAsync())?.OrderByDescending(h => h.PlayerHistoryID)?.FirstOrDefault();

            entity.PlayerHistoryID = (lastHistory?.PlayerHistoryID ?? 0) + 1;
            bool response = await base.InsertAsync(entity);

            return(response);
        }
Exemplo n.º 4
0
        public async Task <PlayerHistoryBE> GetPlayerHistory(int playerHistoryID)
        {
            PlayerHistoryEntity historyEntity = await base.DataSvc.PlayerHistoryRepo.GetByIDAsync(playerHistoryID);

            PlayerHistoryBE historyBE = historyEntity != null
                ? base.Mapper.Map <PlayerHistoryBE>(historyEntity)
                : null;

            return(historyBE);
        }
Exemplo n.º 5
0
        public async Task InsertNewHistory(PlayerHistoryBE historyBE)
        {
            PlayerHistoryEntity historyEntity = base.Mapper.Map <PlayerHistoryEntity>(historyBE);

            historyEntity.CreatedBy       = historyEntity.LastModifiedBy = SystemConstants.DefaultUser;
            historyEntity.CreatedDateTime = historyEntity.LastModifiedDateTime = DateTime.UtcNow;

            await base.DataSvc.PlayerHistoryRepo.InsertAsync(historyEntity);

            historyBE.PlayerHistoryID = historyEntity.PlayerHistoryID;
        }
Exemplo n.º 6
0
        public async Task <bool> UpdateAsync(PlayerHistoryEntity entity)
        {
            List <PlayerHistoryEntity> histories = await GetAsync();

            PlayerHistoryEntity history = histories.SingleOrDefault(h => h.PlayerHistoryID == entity.PlayerHistoryID);

            //PlayerHistoryEntity fields that support manipulation
            history.CompletedDateTime    = entity.CompletedDateTime;
            history.LastModifiedBy       = entity.LastModifiedBy;
            history.LastModifiedDateTime = entity.LastModifiedDateTime;

            bool response = await base.UpdateAsync(histories);

            return(response);
        }