Exemplo n.º 1
0
        public async Task UpdateCategory(ICategoryModel category, CancellationToken token)
        {
            if (category == null)
            {
                return;
            }

            await category.Update(token);
        }
Exemplo n.º 2
0
        public async Task <Product.Common.Models.CategoryResponse> PutCategory(string id, [FromBody] Product.Common.Models.CategoryRequest request)
        {
            _context.Security = new K2SO.Auth.Security(HttpContext.Request.Headers["Authorization"]);
            Guid trackingGuid = Guid.NewGuid();

            if (request == null)
            {
                trackingGuid = IG2000.Data.Utilities.Logging.CreateLogTrackingHeader(null, _context, null);
            }
            else
            {
                trackingGuid = IG2000.Data.Utilities.Logging.CreateLogTrackingHeader(null, _context, request.TrackingGuid);
            }

            Utilities.RestErrorHandler.CheckCategoryRequest(request, _context, trackingGuid);

            long longId = Utilities.RestErrorHandler.CheckId(id, _context, trackingGuid);

            var response = new Product.Common.Models.CategoryResponse();

            response = await _categoryModel.Update(_context, longId, request, trackingGuid);

            return(response);
        }