ASP.NET MVC: ModelState vs. ModelStateDictionary

前端 未结 6 1682
予麋鹿
予麋鹿 2021-02-04 09:32

I have a service which has a method that\'s called when a certain controller method is triggered.

My service returns a custom result object PlacementResult in w

6条回答
  •  后悔当初
    2021-02-04 10:02

    Based on SoC I think you have to return errors from your services and merge them in your ModelState if needed.

    But our objective is maintain decoupling and also to use ModelState.Merge() method. it isn't?

    There is an concrete implementation that could help

提交回复
热议问题