AdventureWorks.WebServices.Controllers.TileNotificationController.GetSecondaryTileNotification C# (CSharp) Метод

GetSecondaryTileNotification() публичный Метод

public GetSecondaryTileNotification ( string id ) : HttpResponseMessage
id string
Результат System.Net.Http.HttpResponseMessage
        public HttpResponseMessage GetSecondaryTileNotification(string id)
        {
            var product = _productRepository.GetProduct(id);
            if (product == null)
            {
                throw new HttpResponseException(HttpStatusCode.NotFound);
            }

            var tileXml = GetSecondaryTileXml(product.ImageUri.AbsoluteUri, product.Title);

            // Create HTTP response
            var response = new HttpResponseMessage();

            // Format response
            response.StatusCode = System.Net.HttpStatusCode.OK;
            response.Content = new StringContent(tileXml);

            // Need to return xml format to TileUpdater.StartPeriodicUpdate
            response.Content.Headers.ContentType =
                new System.Net.Http.Headers.MediaTypeHeaderValue("text/xml");
            return response;
        }