API.Hubs.BaseHub.GetLatestSnapshotForProfile C# (CSharp) Method

GetLatestSnapshotForProfile() public method

public GetLatestSnapshotForProfile ( string profileId ) : Task
profileId string
return Task
        public async Task<SnapshotModel> GetLatestSnapshotForProfile(string profileId)
        {
            var profileModel = await _accountService.GetProfileWithSnapshots(profileId);
            var latestSnapshot = profileModel.Snapshots.OrderByDescending(snapshot => snapshot.Created).FirstOrDefault();
            var snapshotModelWithItems = await _snapshotService.GetSnapshot(latestSnapshot.ClientId);

            LogDebug($"Retrived latest snapshot with worth {snapshotModelWithItems.StashTabs.Sum(s => s.Value)} chaos " + _timer.ElapsedMilliseconds + " ms.");
            return snapshotModelWithItems;
        }