decorators.annotations

Anonymous Coward 2018-03-08 03:42:24.00123 UTC

using System.ComponentModel.DataAnnotations;  


namespace MvcDA {

    [MetadataType(typeof(ProductMD))]
    public partial class Product {

        public class ProductMD {

            [StringLength(50),Required]
            public object Name { get; set; }

            [StringLength(15)]
            public object Color { get; set; }

            [Range(0, 9999)]
            public object Weight { get; set; }
        }
    }
}