首页 > 解决方案 > HttpServiceFactory 接口中的方法太多

问题描述

在我的控制器中,我有这段代码可以正常工作:

var service = HttpServiceFactory.CreateService<IMasterDataService>();
return await service.SetCurrency(pCurrencyDto);

如果我向 IMasterDataServiceDefinition 接口添加一个新方法声明(正确),该接口实现的是 IMasterDataService,我会收到以下错误:

System.TypeInitializationException: The type initializer for 
'MethodHelper_47636508.ServiceDefinitions.MasterData.IMasterDataService' threw an exception. --->
System.IndexOutOfRangeException: Index was outside the bounds of the array.

我认为接口或 HttpServiceFactory 中的某处可能存在方法限制。

你能帮忙解决这个问题吗?谢谢!

标签: c#.net

解决方案


推荐阅读