Added data annotation to have a proper validation on MenuText length based on its maximum length on database. (#8757)

This commit is contained in:
Andrea Piovanelli
2024-02-21 11:21:13 +01:00
committed by GitHub
parent d46f26d4c7
commit eb09ab7f95

View File

@@ -1,5 +1,7 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Orchard.ContentManagement;
using Orchard.Core.Navigation.Models;
namespace Orchard.Core.Navigation.ViewModels {
public class MenuPartViewModel {
@@ -8,6 +10,7 @@ namespace Orchard.Core.Navigation.ViewModels {
public bool OnMenu { get; set; }
public ContentItem ContentItem { get; set; }
[StringLength(MenuPartRecord.DefaultMenuTextLength)]
public string MenuText { get; set; }
}
}