How to pass controller's ModelState to my service constructor with Autofac?
问题 I have a wrapper on ModelStateDictionary which all my services accept. Is it possible to configure the autofac to inject the controller ModelStateDictionary into the constructor of the wrapper and then inject it into service constructor? //code public class ModelValidation : IModelValidation { public ModelValidation(ModelStateDictionary msd){...} .. .. } public class CustomerService{ public CustomerService(IModelValidation mv){...} .. } Thanks 回答1: Based on your comments I hereby revise my