第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

如何獲取DataAnnotation顯示名稱的列表

如何獲取DataAnnotation顯示名稱的列表

C#
qq_笑_17 2021-04-02 22:18:50
我有一個(gè)帶有數(shù)據(jù)注釋的類,需要從顯示和屬性名稱獲取字符串列表。我已經(jīng)嘗試了一些方法。在方法GetAttributesNames()中。internal class TVSystemViewData : BaseViewData        {            [Display(Name = "BoxType", Description = "")]            public String BoxType { get; set; }            [Display(Name = "BoxVendor", Description = "")]            public String BoxVendor { get; set; }            [Display(Name = "ClientId", Description = "")]            public String ClientId { get; set; }            [Display(Name = "HostName", Description = "")]            public String HostName { get; set; }            [Display(Name = "OSVersion", Description = "")]            public String OSVersion { get; set; }            [Display(Name = "SerialNumber", Description = "")]            public String SerialNumber { get; set; }            internal void GetAttributesNames()            {                var listOfFieldNames = typeof(TVSystemViewData)                .GetProperties()                .Select(x =>  x.GetCustomAttributes(typeof(DisplayAttribute), true))                .Where(x => x != null)                .ToList();            }}
查看完整描述

2 回答

  • 2 回答
  • 0 關(guān)注
  • 205 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號