public async Task SaveCategory(ICategoryModel newCategory, CancellationToken token) { if (newCategory == null) { return; } await newCategory.Save(token); }
public async Task <Product.Common.Models.CategoryResponse> PostCategory([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); var response = new Product.Common.Models.CategoryResponse(); response = await _categoryModel.Save(_context, request, trackingGuid); return(response); }