如何给EF自动生成的类添加Meta

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace TravelBusiness
{
    [MetadataType(typeof(HTL_HotelMetadata))]
    public partial class HTL_Hotel
    {
        private class HTL_HotelMetadata
        {
            #region 基元属性

            //public global::System.Decimal BookRoomID {get; set;}

            //public Nullable<global::System.Decimal> RoomCatalogID { get; set; }

            [Required(ErrorMessage="请输入酒店的名称")]
            [DisplayName("酒店名称")]
            public global::System.String Name { get; set; }

            [Required(ErrorMessage = "请输入酒店星级")]
            [DisplayName("星级")]
            public global::System.String Star { get; set; }

posted @ 2011-06-01 20:54  Ken-Cai  阅读(246)  评论(0编辑  收藏  举报