日韩天天综合网_野战两个奶头被亲到高潮_亚洲日韩欧美精品综合_av女人天堂污污污_视频一区**字幕无弹窗_国产亚洲欧美小视频_国内性爱精品在线免费视频_国产一级电影在线播放_日韩欧美内地福利_亚洲一二三不卡片区

.net使用自定義類屬性實(shí)例(2)_.Net教程

編輯Tag賺U幣
教程Tag:暫無(wú)Tag,歡迎添加,賺取U幣!

推薦:.NET實(shí)現(xiàn)在網(wǎng)頁(yè)中預(yù)覽Office文件的3個(gè)方法
近日公司要搞一個(gè)日常的文檔管理的東東,可以上傳、下載各種文件,如果是office文件呢還必須得支持預(yù)覽功能,其他的都好說(shuō)但是唯獨(dú)office預(yù)覽功能比較麻煩,但是不能不做,廢話不多說(shuō)了一步步來(lái)吧。分析了下網(wǎng)易郵箱的文件預(yù)覽功能,他用的是微軟的組件,最早叫Office

 

代碼如下: [Table("Wincms_Dictionary")]            ///映射到數(shù)據(jù)庫(kù)的Wincms_Dictionary表
public class Wincms_Dictionary : BaseEntity
{
         private int _DictionaryId;
 
         public Wincms_Dictionary()
         {
         }
 
        [Field("DictionaryId",DbType.Int32)]                ///映射到數(shù)據(jù)庫(kù)的Wincms_Dictionary表中的字段
        public int DictionaryId
        {
            get { return this._DictionaryId; }
            set
            {
                this._DictionaryId = value;
            }
        }
}
 
///基于實(shí)體類獲取實(shí)體對(duì)應(yīng)的表名稱和字段名稱
public class Test
{
 
       public static void main(string[] args)
        {
               Wincms_Dictionary dict=new Wincms_Dictionary();
               Console.WriteLine("表名稱:"+GetTableName(dict));
               Console.WriteLine("字段名稱:"+GetFieldName(dict,"DictionaryId"));
               Console.Read();
        }
 
       ///獲取實(shí)體表名稱
       public  static string GetTableName(BaseEntity entity)
       {
                return entity.GetTableName();
       }
 
       ///獲取實(shí)體字段名稱
       public static string GetFieldName(BaseEntity entity,string propertyName)
       {
              FieldAttribute fieldAttribute=entity.GetFieldAttribute(propertyName);
              return fieldAttribute.FieldName;
       }
}


輸出結(jié)果為:

 

 

代碼如下: 表名稱:Wincms_Dictionary
字段名稱:DictionaryId

分享:asp.net中控制反轉(zhuǎn)怎么理解?
對(duì)IOC的解釋為:Inversion of control is a common characteristic of frameworks, so saying that these lightweight containers are special because they use inversion of control is like saying my car is special because it has wheels. 我想對(duì)這一概念執(zhí)行

共2頁(yè)上一頁(yè)12下一頁(yè)
來(lái)源:模板無(wú)憂//所屬分類:.Net教程/更新時(shí)間:2014-10-15
相關(guān).Net教程