Controller 这一层首先要添加对WCF 的引用:

如下,输入我们自己的wcf地址
http://localhost:8732/Design_Time_Addresses/InfoPub.BLLService/Service1/mex
为了解析嵌套结构的类,我们加入JsonBinder
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Script.Serialization;
namespace InfoPub.Controllers
{
public class JsonBinder<T> : IModelBinder
{

本文详细介绍了如何在Controller层中处理WCF引用,使用JsonBinder进行嵌套类解析,以及创建InfoController、InfoTypeController和UserInfoController等控制器,并展示了GetInfoList、GetInfoById、AddInfo、UpdateInfo和DeleteInfo等关键操作的方法实现,用于信息的增删查改操作。
订阅专栏 解锁全文
2万+

被折叠的 条评论
为什么被折叠?



