예제 #1
0
        public async Task <IActionResult> Update(PlatformUserDataResult request)
        {
            using var session = _documentStore.OpenAsyncSession();
            // Get platform
            var platform = await _platformManager.GetPlatformByTokenAsync(request.PlatformToken, session);

            // If there is no platform found, maybe this didn't come from a registered platform
            if (platform == null)
            {
                // TODO: Log this

                return(BadRequest($"There is no platform registered with the token provided."));
            }

            return(Ok("Update received."));
        }
 public async Task <Core.Entities.Platform> Get([FromHeader] string platformToken)
 {
     using var session = _documentStore.OpenAsyncSession();
     return(await _platformManager.GetPlatformByTokenAsync(platformToken, session));
 }