public IProductVariant BuildEntity(ProductVariantDto dto) { var entity = new ProductVariant(dto.Name, dto.Sku, dto.Price) { Key = dto.Key, ProductKey = dto.ProductKey, CostOfGoods = dto.CostOfGoods, SalePrice = dto.SalePrice, OnSale = dto.OnSale, Manufacturer = dto.Manufacturer, ManufacturerModelNumber = dto.ManufacturerModelNumber, Weight = dto.Weight, Length = dto.Length, Height = dto.Height, Width = dto.Width, Barcode = dto.Barcode, Available = dto.Available, TrackInventory = dto.TrackInventory, OutOfStockPurchase = dto.OutOfStockPurchase, Taxable = dto.Taxable, Shippable = dto.Shippable, Download = dto.Download, DownloadMediaId = dto.DownloadMediaId, Master = dto.Master, ExamineId = dto.ProductVariantIndexDto.Id, CatalogInventoryCollection = _catalogInventories, ProductAttributes = _productAttributeCollection, UpdateDate = dto.UpdateDate, CreateDate = dto.CreateDate }; entity.ResetDirtyProperties(); return(entity); }