Skip to content

Commit

Permalink
Revert "BE: PropertyValidator.cs restore rule for product.Code. (#283)"
Browse files Browse the repository at this point in the history
This reverts commit fc47f26.
  • Loading branch information
kostyrin committed Dec 9, 2019
1 parent eadb6cc commit a3dc561
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/VirtoCommerce.CatalogModule.Core/Model/Property.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public class Property : AuditableEntity, IInheritable, ICloneable, IHasOuterId,
public string CategoryId { get; set; }
[JsonIgnore]
public Category Category { get; set; }
public string Code { get; set; }
public string Name { get; set; }
public bool Required { get; set; }
public bool Dictionary { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ public PropertyValidator()

//RuleFor(property => property.CatalogId).NotNull().NotEmpty();
RuleFor(property => property.Name).NotNull().NotEmpty().WithMessage(x => $"Name is null or empty").MaximumLength(128);
RuleFor(product => product.Code).NotNull().NotEmpty()
.MaximumLength(64)
.DependentRules(() => RuleFor(product => product.Code)
.Must(x => x.IndexOfAny(_illegalCodeChars) < 0)
.WithMessage("product code contains illegal chars"));
}
}
}

0 comments on commit a3dc561

Please sign in to comment.