创建对象并作为Web服务的参数传递

时间:2014-04-21 06:31:22

标签: c# asp.net .net web-services

我在将对象作为webservice

中的参数传递时遇到问题

我的网络服务和表示层共享相同的实体定义

到目前为止工作正常,但是当我更新服务参考并尝试构建它时, 这是在抛出错误,

'Competition' is an ambiguous reference between 'Entity.BusinessEntities.Competition' 
and 'presentation.ServiceReference.Competition' 

所以我把它改成了

Entity.BusinessEntities.Competition=new Entity.BusinessEntities.Competition()代替 Competition= new Competition()

但网络服务不接受该对象!!

Service.CreateCompetition(Competition);

它说

 Cannot implicitly convert type 'Entity.BusinessEntities.Competition' to 
'presentation.ServiceReference.Competition' 

0 个答案:

没有答案