public async Task <Product.Common.Models.ProductAlternateIdResponse> GetProductVariantAltId(string id, [FromQuery] Guid?trackingGuid = null) { _context.Security = new K2SO.Auth.Security(HttpContext.Request.Headers["Authorization"]); trackingGuid = IG2000.Data.Utilities.Logging.CreateLogTrackingHeader(trackingGuid, _context); var response = new Product.Common.Models.ProductAlternateIdResponse(); response = await _alternativeIdModel.GetById(_context, id, "PC_ProductVariant", (Guid)trackingGuid); return(response); }
public async Task <Product.Common.Models.ProductAlternateIdResponse> GetAlternateId(string id, [FromQuery] Guid?trackingGuid = null) { _context.Security = new K2SO.Auth.Security(HttpContext.Request.Headers["Authorization"]); trackingGuid = IG2000.Data.Utilities.Logging.CreateLogTrackingHeader(trackingGuid, _context); if (string.IsNullOrEmpty(id)) { IG2000.Data.Utilities.Logging.LogTrackingEvent($"Id ({id}) invalid! Reason: Id is null or empty", $"Status Code: 400 Bad Request", LT319.Common.Utilities.Constants.TrackingStatus.Error, _context, (Guid)trackingGuid); throw new HttpResponseException() { StatusCode = Microsoft.AspNetCore.Http.StatusCodes.Status400BadRequest, ReasonPhrase = "Id is null or empty" }; } var response = new Product.Common.Models.ProductAlternateIdResponse(); response = await _alternateIdModel.GetById(_context, id, "PC_Product", (Guid)trackingGuid); return(response); }