I am trying to move my login method from a controller action into a service class. On compilation I'm being told that System.Web.Mvc.ModelState does not contain a definition for 'IsValid'
Am I missing a using statement?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
ModelState
is both the name of a property on the Controller baseclass and the name of a class.
The code you moved was using the property, the error comes from trying to use the class instead.