且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

无法将类型'System.Collections.Generic.List转换为'System.Collections.Generic.List

更新时间:2023-01-17 21:19:45

方法"GetAllClaimRegistrationRecords()"已经返回"List< tblclaimregistration>".类型.

因此,您不需要询问ToList()...

那就做吧:
The method "GetAllClaimRegistrationRecords()" already return a "List<tblclaimregistration>" type.

So you doesn''t need to ask for ToList()...

Just do it :
List<tblClaimRegistration> ClaimRegistartion= svc.GetAllClaimRegistrationRecords()


我得到了解决方案:

i got the solution :

[HttpPost]
    public ActionResult ToControl()
    {
        ServiceReference1.Service1Client svc = new ServiceReference1.Service1Client();
       
 ViewData["ClaimRegistartion"] = svc.GetAllClaimRegistrationRecords();
 
        return View("TestView");
      
    }



它将起作用.



it will work.