using System.ComponentModel.DataAnnotations;
using ZelWiki.Models.DataModels;

namespace ZelWiki.Models.ViewModels.Admin
{
    public class MenuItemViewModel : ViewModelBase
    {
        public int Id { get; set; }
        [Display(Name = "分类")]
        public string Name { get; set; } = string.Empty;
        [Display(Name = "链接")]
        public string Link { get; set; } = string.Empty;
        [Display(Name = "序列")]
        public int Ordinal { get; set; }

        public MenuItem ToDataModel()
        {
            return new MenuItem
            {
                Name = Name,
                Id = Id,
                Link = Link,
                Ordinal = Ordinal
            };
        }
    }
}
