1 using System;
 2 using System.Web.Http;
 3 using Common;
 4 
 5 namespace ConsoleApp
 6 {
 7     internal class Program
 8     {
 9         private static void Main(string[] args)
10         {
11             var configuration = new HttpConfiguration();
12             var metaDataProvider = configuration.Services.GetModelMetadataProvider();
13             Console.WriteLine("{0,-14}{1,-15}{2,-26}{3}", "PropertyName", "Description", "ConvertEmptyStringToNull", "IsReadOnly");
14             foreach (var data in metaDataProvider.GetMetadataForType(null, typeof (Contact)).Properties)
15             {
16                 Console.WriteLine("{0,-14}{1,-15}{2,-26}{3}", data.PropertyName, data.Description, data.ConvertEmptyStringToNull, data.IsReadOnly);
17             }
18             Console.Read();
19         }
20     }
21 }

 

相关文章:

  • 2022-12-23
  • 2022-01-10
  • 2021-12-18
  • 2022-02-07
  • 2021-08-25
  • 2021-06-23
猜你喜欢
  • 2022-12-23
  • 2021-05-18
  • 2021-11-29
  • 2021-12-14
  • 2021-08-25
  • 2022-01-28
相关资源
相似解决方案