Ejemplo n.º 1
0
        protected bool LoadEntityDataBeforeSave(MappingForm model)
        {
            var product = _productService.FindSingle(new Specification <Product>(p => p.Sku == model.Sku));

            if (product == null)
            {
                ModelState.AddModelError("Sku", "Sku not found");
                return(false);
            }
            model.ProductId = product.Id;
            return(true);
        }