模型验证

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace MVC_Controller.Models.ViewModels
{
[MetadataType(typeof(ProductMD))]
public partial class Product
{
public class ProductMD
{
public string Name { get; set; }
public string Book { get; set; }
public IEnumerable<Product> Product { get; set; }
public IEnumerable<Category> Category { get; set; }
}
}
}

posted on 2018-11-15 06:58  血气方刚  阅读(182)  评论(0编辑  收藏  举报

导航