public async Task <bool> RequestOne(string accountId, int count) { var profileId = _httpContextAccessor.GetUserIdentifier(); var profile = _profilesService.GetSingleByParameter( e => e.ProfileId == profileId && e.AccountId == accountId ); // TODO: filter transactions await Clients.Caller.SendAsync("ResponseOne", profile?.ToProfileDto()); var pipeline = profileId.ToMongoPipelineMatchSingle <ProfileEntity>(accountId); var enumerator = _profilesService.SubscribeToChangesMany(pipeline); while (enumerator.MoveNext()) { if (enumerator.Current != null) { await Clients.Caller.SendAsync( "ResponseOne", enumerator.Current.FullDocument.ToProfileDto() ); } } return(true); }