/// <summary>
 /// Lists a collection of products in the specified service instance.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='serviceName'>
 /// The name of the API Management service.
 /// </param>
 /// <param name='odataQuery'>
 /// OData parameters to apply to the operation.
 /// </param>
 /// <param name='expandGroups'>
 /// When set to true, the response contains an array of groups that have
 /// visibility to the product. The default is false.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <ProductContract> > ListByServiceAsync(this IProductOperations operations, string resourceGroupName, string serviceName, ODataQuery <ProductContract> odataQuery = default(ODataQuery <ProductContract>), bool?expandGroups = default(bool?), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListByServiceWithHttpMessagesAsync(resourceGroupName, serviceName, odataQuery, expandGroups, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Lists a collection of products in the specified service instance.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <ProductContract> > ListByServiceNextAsync(this IProductOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListByServiceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Gets the details of the product specified by its identifier.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='serviceName'>
 /// The name of the API Management service.
 /// </param>
 /// <param name='productId'>
 /// Product identifier. Must be unique in the current API Management service
 /// instance.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ProductContract> GetAsync(this IProductOperations operations, string resourceGroupName, string serviceName, string productId, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serviceName, productId, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Creates or Updates a product.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='serviceName'>
 /// The name of the API Management service.
 /// </param>
 /// <param name='productId'>
 /// Product identifier. Must be unique in the current API Management service
 /// instance.
 /// </param>
 /// <param name='parameters'>
 /// Create or update parameters.
 /// </param>
 /// <param name='ifMatch'>
 /// ETag of the Entity. Not required when creating an entity, but required when
 /// updating an entity.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ProductContract> CreateOrUpdateAsync(this IProductOperations operations, string resourceGroupName, string serviceName, string productId, ProductContract parameters, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, productId, parameters, ifMatch, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <param name='operations'>
 /// Reference to the ProductServiceClient.IProductOperations.
 /// </param>
 public static IList <Product> Get(this IProductOperations operations)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IProductOperations)s).GetAsync();
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Example #6
0
 public BasketManager(IBasketOperations basketOperations, ICampaignOperations campaignOperations,
                      ICategoryOperations categoryOperations, ICouponOperations couponOperations,
                      IProductOperations productOperations)
 {
     _basketOperations   = basketOperations;
     _campaignOperations = campaignOperations;
     _categoryOperations = categoryOperations;
     _couponOperations   = couponOperations;
     _productOperations  = productOperations;
 }
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     this.EntryOperations   = new EntryOperations(this);
     this.ProductOperations = new ProductOperations(this);
     this.BaseUri           = new Uri("http://localhost:53144");
     SerializationSettings  = new JsonSerializerSettings
     {
         Formatting            = Formatting.Indented,
         DateFormatHandling    = DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = DateTimeZoneHandling.Utc,
         NullValueHandling     = NullValueHandling.Ignore,
         ReferenceLoopHandling = ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver()
     };
     DeserializationSettings = new JsonSerializerSettings {
         DateFormatHandling    = DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = DateTimeZoneHandling.Utc,
         NullValueHandling     = NullValueHandling.Ignore,
         ReferenceLoopHandling = ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver()
     };
 }
Example #8
0
        /// <summary>
        /// </summary>
        /// <param name='operations'>
        /// The operations group for this extension method.
        /// </param>
        /// <param name='productId'>
        /// The product Id.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        public static async Task <Product> GetProductAsync(this IProductOperations operations, int?productId, CancellationToken cancellationToken = default(CancellationToken))
        {
            HttpOperationResponse <Product> result = await operations.GetProductWithHttpMessagesAsync(productId, null, cancellationToken).ConfigureAwait(false);

            return(result.Body);
        }
Example #9
0
 /// <summary>
 /// Initializes a new instance of the ProductServiceClientClient class.
 /// </summary>
 /// <param name='rootHandler'>
 /// Optional. The http client handler used to handle http transport.
 /// </param>
 /// <param name='handlers'>
 /// Optional. The set of delegating handlers to insert in the http
 /// client pipeline.
 /// </param>
 public ProductServiceClientClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers)
     : base(rootHandler, handlers)
 {
     this._product = new ProductOperations(this);
     this._baseUri = new Uri("http://localhost:10139");
 }
Example #10
0
 public GamesController(IGameQueries gameQueries, IProductOperations productOperations)
 {
     _gameQueries       = gameQueries;
     _productOperations = productOperations;
 }
 public ProductController(IProductOperations product)
 {
     productOperations = product;
 }
 /// <summary>
 /// Gets the details of the product specified by its identifier.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='serviceName'>
 /// The name of the API Management service.
 /// </param>
 /// <param name='productId'>
 /// Product identifier. Must be unique in the current API Management service
 /// instance.
 /// </param>
 public static ProductContract Get(this IProductOperations operations, string resourceGroupName, string serviceName, string productId)
 {
     return(operations.GetAsync(resourceGroupName, serviceName, productId).GetAwaiter().GetResult());
 }
 public ProductController(IProductOperations productOperations)
 {
     _productOperations = productOperations;
 }
Example #14
0
 /// <summary>
 /// Lists a collection of products associated with tags.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 public static IPage <TagResourceContract> ListByTagsNext(this IProductOperations operations, string nextPageLink)
 {
     return(operations.ListByTagsNextAsync(nextPageLink).GetAwaiter().GetResult());
 }
Example #15
0
 /// <summary>
 /// Lists a collection of products associated with tags.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='serviceName'>
 /// The name of the API Management service.
 /// </param>
 /// <param name='odataQuery'>
 /// OData parameters to apply to the operation.
 /// </param>
 /// <param name='includeNotTaggedProducts'>
 /// Include not tagged Products.
 /// </param>
 public static IPage <TagResourceContract> ListByTags(this IProductOperations operations, string resourceGroupName, string serviceName, ODataQuery <TagResourceContract> odataQuery = default(ODataQuery <TagResourceContract>), bool?includeNotTaggedProducts = default(bool?))
 {
     return(operations.ListByTagsAsync(resourceGroupName, serviceName, odataQuery, includeNotTaggedProducts).GetAwaiter().GetResult());
 }
Example #16
0
 public ProductsController(IProductOperations productOperations, IOptions <TokenAuthentification> tokenAuthentication, IMapper mapper)
 {
     _productOperations   = productOperations;
     _tokenAuthentication = tokenAuthentication.Value;
     _mapper = mapper;
 }
 /// <summary>
 /// Lists a collection of products in the specified service instance.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='serviceName'>
 /// The name of the API Management service.
 /// </param>
 /// <param name='odataQuery'>
 /// OData parameters to apply to the operation.
 /// </param>
 /// <param name='expandGroups'>
 /// When set to true, the response contains an array of groups that have
 /// visibility to the product. The default is false.
 /// </param>
 public static IPage <ProductContract> ListByService(this IProductOperations operations, string resourceGroupName, string serviceName, ODataQuery <ProductContract> odataQuery = default(ODataQuery <ProductContract>), bool?expandGroups = default(bool?))
 {
     return(operations.ListByServiceAsync(resourceGroupName, serviceName, odataQuery, expandGroups).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Creates or Updates a product.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='serviceName'>
 /// The name of the API Management service.
 /// </param>
 /// <param name='productId'>
 /// Product identifier. Must be unique in the current API Management service
 /// instance.
 /// </param>
 /// <param name='parameters'>
 /// Create or update parameters.
 /// </param>
 /// <param name='ifMatch'>
 /// ETag of the Entity. Not required when creating an entity, but required when
 /// updating an entity.
 /// </param>
 public static ProductContract CreateOrUpdate(this IProductOperations operations, string resourceGroupName, string serviceName, string productId, ProductContract parameters, string ifMatch = default(string))
 {
     return(operations.CreateOrUpdateAsync(resourceGroupName, serviceName, productId, parameters, ifMatch).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Gets the entity state (Etag) version of the product specified by its
 /// identifier.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='serviceName'>
 /// The name of the API Management service.
 /// </param>
 /// <param name='productId'>
 /// Product identifier. Must be unique in the current API Management service
 /// instance.
 /// </param>
 public static ProductGetEntityTagHeaders GetEntityTag(this IProductOperations operations, string resourceGroupName, string serviceName, string productId)
 {
     return(operations.GetEntityTagAsync(resourceGroupName, serviceName, productId).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Update product.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='serviceName'>
 /// The name of the API Management service.
 /// </param>
 /// <param name='productId'>
 /// Product identifier. Must be unique in the current API Management service
 /// instance.
 /// </param>
 /// <param name='parameters'>
 /// Update parameters.
 /// </param>
 /// <param name='ifMatch'>
 /// ETag of the Entity. ETag should match the current entity state from the
 /// header response of the GET request or it should be * for unconditional
 /// update.
 /// </param>
 public static void Update(this IProductOperations operations, string resourceGroupName, string serviceName, string productId, ProductUpdateParameters parameters, string ifMatch)
 {
     operations.UpdateAsync(resourceGroupName, serviceName, productId, parameters, ifMatch).GetAwaiter().GetResult();
 }
Example #21
0
 public ProductsController(ProductOperations productService)
 {
     this.service = productService;
 }
 /// <summary>
 /// Update product.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='serviceName'>
 /// The name of the API Management service.
 /// </param>
 /// <param name='productId'>
 /// Product identifier. Must be unique in the current API Management service
 /// instance.
 /// </param>
 /// <param name='parameters'>
 /// Update parameters.
 /// </param>
 /// <param name='ifMatch'>
 /// ETag of the Entity. ETag should match the current entity state from the
 /// header response of the GET request or it should be * for unconditional
 /// update.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task UpdateAsync(this IProductOperations operations, string resourceGroupName, string serviceName, string productId, ProductUpdateParameters parameters, string ifMatch, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.UpdateWithHttpMessagesAsync(resourceGroupName, serviceName, productId, parameters, ifMatch, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
Example #23
0
 /// <summary>
 /// Initializes a new instance of the ProductServiceClientClient class.
 /// </summary>
 public ProductServiceClientClient()
     : base()
 {
     this._product = new ProductOperations(this);
     this._baseUri = new Uri("http://localhost:5137");
 }
 /// <summary>
 /// Delete product.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='serviceName'>
 /// The name of the API Management service.
 /// </param>
 /// <param name='productId'>
 /// Product identifier. Must be unique in the current API Management service
 /// instance.
 /// </param>
 /// <param name='ifMatch'>
 /// ETag of the Entity. ETag should match the current entity state from the
 /// header response of the GET request or it should be * for unconditional
 /// update.
 /// </param>
 /// <param name='deleteSubscriptions'>
 /// Delete existing subscriptions associated with the product or not.
 /// </param>
 public static void Delete(this IProductOperations operations, string resourceGroupName, string serviceName, string productId, string ifMatch, bool?deleteSubscriptions = default(bool?))
 {
     operations.DeleteAsync(resourceGroupName, serviceName, productId, ifMatch, deleteSubscriptions).GetAwaiter().GetResult();
 }
 public HomeController(IProductOperations productOperations, IMapper mapper)
 {
     _productOperations = productOperations;
     _mapper            = mapper;
 }
 /// <summary>
 /// Delete product.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='serviceName'>
 /// The name of the API Management service.
 /// </param>
 /// <param name='productId'>
 /// Product identifier. Must be unique in the current API Management service
 /// instance.
 /// </param>
 /// <param name='ifMatch'>
 /// ETag of the Entity. ETag should match the current entity state from the
 /// header response of the GET request or it should be * for unconditional
 /// update.
 /// </param>
 /// <param name='deleteSubscriptions'>
 /// Delete existing subscriptions associated with the product or not.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteAsync(this IProductOperations operations, string resourceGroupName, string serviceName, string productId, string ifMatch, bool?deleteSubscriptions = default(bool?), CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serviceName, productId, ifMatch, deleteSubscriptions, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
Example #27
0
 public ProductController(IProductOperations productOperations, IHostingEnvironment hostingEnvironment)
 {
     this.productOperations  = productOperations;
     this.hostingEnvironment = hostingEnvironment;
 }
 /// <summary>
 /// Lists a collection of products in the specified service instance.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 public static IPage <ProductContract> ListByServiceNext(this IProductOperations operations, string nextPageLink)
 {
     return(operations.ListByServiceNextAsync(nextPageLink).GetAwaiter().GetResult());
 }
        /// <param name='operations'>
        /// Reference to the ProductServiceClient.IProductOperations.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        public static async Task <IList <Product> > GetAsync(this IProductOperations operations, CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            Microsoft.Rest.HttpOperationResponse <System.Collections.Generic.IList <global::ProductServiceClient.Models.Product> > result = await operations.GetWithOperationResponseAsync(cancellationToken).ConfigureAwait(false);

            return(result.Body);
        }
Example #30
0
 /// <summary>
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='productId'>
 /// The product Id.
 /// </param>
 public static Product GetProduct(this IProductOperations operations, int?productId)
 {
     return(Task.Factory.StartNew(s => ((IProductOperations)s).GetProductAsync(productId), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }