예제 #1
0
        public async Task <SnapshotProfileModel> GetActiveProfileWithSnapshots(string accountId)
        {
            var profile = await _accountRepository.GetProfiles(profile => profile.Account.ClientId == accountId && profile.Active).FirstOrDefaultAsync();

            var snapshots = await _snapshotRepository.GetSnapshots(snapshot => snapshot.ProfileClientId == profile.ClientId).ToListAsync();

            var profileModel = _mapper.Map <SnapshotProfileModel>(profile);

            profileModel.Snapshots = _mapper.Map <List <SnapshotModel> >(snapshots);
            return(profileModel);
        }
예제 #2
0
        public async Task <SnapshotModel> GetSnapshot(string snapshotClientId)
        {
            var snapshot = await _snapshotRepository.GetSnapshots(snapshot => snapshot.ClientId == snapshotClientId).FirstAsync();

            snapshot.StashTabs = await _snapshotRepository.GetStashtabs(stashtab => stashtab.SnapshotClientId == snapshotClientId).ToListAsync();

            foreach (var stashtab in snapshot.StashTabs)
            {
                stashtab.PricedItems = await _snapshotRepository.GetPricedItems(p => p.StashtabClientId == stashtab.ClientId).ToListAsync();
            }

            return(_mapper.Map <SnapshotModel>(snapshot));
        }
예제 #3
0
        public async Task <SnapshotModel> GetSnapshot(string snapshotClientId)
        {
            var snapshot = await _snapshotRepository.GetSnapshots(snapshot => snapshot.ClientId == snapshotClientId).FirstAsync();

            return(_mapper.Map <SnapshotModel>(snapshot));
        }