Silverlight wcf服务 - 更改方法的返回值

时间:2014-04-14 12:04:55

标签: wcf silverlight

在我的服务中,我有一个返回bool的方法,但后来我将其更改为IList,我更新了 通过右键单击服务引用并进行更新来进行服务。但是更新没有更新方法返回值。对于此代码,我收到一条错误消息,指出“无法将类型bool隐式转换为System.Collection.Generic.IList< ..>”

patientService.SavePatient(personID, firstName, lastName, causeOfVisit,(s, e) => PatientData = e.Result);

服务中的方法:

    [OperationContract]
    public IList<Patient> SavePatient(string personId, string firstName, string lastName, DateTime TimeOfArrival, string causeOfVisit)
    {
        patientRepository.SavePatient(personId, firstName, lastName, TimeOfArrival, causeOfVisit);
        return patientRepository.Patients;
    }

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

当您更改返回bool到IList时,您是否在进行更新服务参考之前在顶层菜单中构建解决方案?因为在我看来它仍然是返回bool,因为你忘了那一步,它需要在服务器端(Projectname.web)更新一个更新,你在那里通过构建解决方案和客户端来定义WCF更新服务参考。


WCFservice.TopicInfoAsync(query_topics, (int)numberOfTopics);
WCFservice.TopicInfoCompleted += (Stopicinfo, EAtopicinfo) =>
{
   TopicList = EAtopicinfo.Result;
}