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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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 {
@ -7,7 +9,8 @@ namespace Orchard.Core.Navigation.ViewModels {
public int CurrentMenuId { get; set; }
public bool OnMenu { get; set; }
public ContentItem ContentItem { get; set; }
public ContentItem ContentItem { get; set; }
[StringLength(MenuPartRecord.DefaultMenuTextLength)]
public string MenuText { get; set; }
}
}