我有一个 WCF 服务,并且一个方法在调用我需要访问该接口的服务时接受一个接口 IValidationDictionary,但是 VS 生成的代理类将该接口显示为一个对象。我试图向界面添加数据属性,但这是不允许的。
提前致谢。
public class UserService : IUserService
{
private IValidationDictionary validatonDictionary;
private IUserAppService userAppService;
public UserService(IUserAppService userAppService)
{
this.userAppService = userAppService;
}
public void SetValidation(IValidationDictionary validationDictionary)
{
this.validatonDictionary = validationDictionary;
}
public UserDTO GetUser(int id)
{
return this.userAppService.GetUser(id);
}
}
public interface IValidationDictionary
{
void AddError(string key, string errorMessage);
bool IsValid();
}