csharp System.ComponentModel.DataAnnotations.UIHintAttribute类(方法)实例源码

下面列出了csharp System.ComponentModel.DataAnnotations.UIHintAttribute 类(方法)源码代码实例,从而了解它的用法。

作者:.NET开发    项目:System.ComponentModel.DataAnnotation   
//引入命名空间
using System;
using System.Web.DynamicData;
using System.ComponentModel.DataAnnotations;

[MetadataType(typeof(ProductMetadata))]
public partial class Product 
{
}

public partial class ProductMetadata
{
    [UIHint("UnitsInStock")]
    [Range(100, 10000, 
    ErrorMessage = "Units in stock should be between {1} and {2}.")]
    public object UnitsInStock;
}


问题


面经


文章

微信
公众号

扫码关注公众号