2017-04-20 52 views

回答

2

命名空間System.ComponentModel.DataAnnotations的類型爲the System.ComponentModel.Annotations package,默認情況下,它不會安裝在.Net標準庫中,因此您需要手動安裝它才能在此處使用它。

如果您的意思是Type.GetProperties(),那麼該方法在.Net Core和.Net Standard中作爲擴展方法存在。在.Net標準庫中,您需要安裝the System.Reflection.TypeExtensions package。在.Net核心應用程序和.Net標準庫中,您需要將using System.Reflection;添加到您的源代碼中。

+0

非常感謝:) – coffeedrunk