标签:asp.net-mvc-viewmodel
-
是否可以在ViewModel中重用DataAnnotations? - c#
在我的MVC应用程序中,我在域模型中定义了DataAnnotations。尽管在使用Domain模型时可以检索诸如Display等的DataAnnotations属性,但在ViewModel上使用相同的属性并使用此ViewModel时,则无法检索它们。我认为在ViewModel中再次定义DataAnnotations似乎不太好。那么,有可能还是我应该遵循哪种 […]