Я использую некоммерческую версию 2.6. Поэтому я пытаюсь добавить новый продукт в панель администратора. Я ввожу все данные, а затем нажимаю кнопку «Сохранить» или кнопку «Сохранить и продолжить редактирование».
У меня такая ошибка.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 546: //default product variant
Line 547: var variant = model.FirstProductVariantModel.ToEntity();
Line 548: variant.ProductId = product.Id;
Line 549: variant.Published = true;
Line 550: variant.DisplayOrder = 1;
Мой код ниже, который имеет ошибку..
var variant = model.FirstProductVariantModel.ToEntity();
variant.ProductId = product.Id;
variant.Published = true;
variant.DisplayOrder = 1;
variant.CreatedOnUtc = DateTime.UtcNow;
variant.UpdatedOnUtc = DateTime.UtcNow;
_productService.InsertProductVariant(variant);
FirstVariant_UpdateLocales(variant, model.FirstProductVariantModel);
Как я могу любить это ..
Пожалуйста, помогите... Спасибо