Exemplo n.º 1
0
        public async Task <UserPlatformConnection> GetAsync(PlatformToken platformToken, UserName username)
        {
            using (IAsyncDocumentSession session = _documentStore.OpenAsyncSession())
            {
                var connection = await session.Query <UserPlatformConnection>().FirstOrDefaultAsync(f => f.PlatformToken == platformToken.Value && f.Username == username.Value);

                return(connection);
            }
        }
Exemplo n.º 2
0
        public async Task <Platform> GetPlatformByTokenAsync(PlatformToken platformToken, IAsyncDocumentSession session)
        {
            var project = await
                          session
                          .Query <Project>()
                          .Where(p => p.Platforms.Any(a => a.PlatformToken == platformToken.Value))
                          .FirstOrDefaultAsync();

            return(project?
                   .Platforms?
                   .FirstOrDefault());
        }