该问题出现的原因是由于代码中将ServiceResult
在需要进行赋值操作的地方,使用强制类型转换或者通过ServiceResult
ServiceResult
// 强制类型转换 AuthResult authResult = (AuthResult)serviceResult;
// 使用属性获取AuthResult对象 AuthResult authResult = serviceResult.Result;
// 使用方法获取AuthResult对象 AuthResult authResult = serviceResult.GetResult();
上一篇:ASP.NETCoreWebAPI-无法为服务类型实例化实现类型'System.Net.Http.IHttpClientFactory'
下一篇:ASP.NETCoreWebAPI-无法隐式转换类型“Response<LoginResponseDto>为“Response<bool>