public async Task <PlayerHistoryEntity> GetByIDAsync(int playerHistoryID) { List <PlayerHistoryEntity> historyEntities = await GetAsync(); PlayerHistoryEntity historyEntity = historyEntities?.SingleOrDefault(h => h.PlayerHistoryID == playerHistoryID); return(historyEntity); }
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); }
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); }
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); }
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; }
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); }