Example #1
0
 public void IsValide(Product model)
 {
     _context.Clear();
     model.Validate(ref model._name, model => model.Name?.Trim(), string.IsNullOrEmpty, "empty_product_name", _localizer["empty_product_name"], _context);
     if (!_context.IsValid)
     {
         throw new MicroSException("validation", _context.ToString());
     }
 }