我正在尝试创建一个WCF服务。该服务必须在数据库中输入数据。但是,一旦我测试它,我得到的错误是我的方法是Async()。那是为什么?
namespace Test1
{
[ServiceContract]
public interface IService1
{
[OperationContract]
void SetInsurance(InsuranceDetails insInfo);
}
[DataContract]
public class InsuranceDetails
{
[DataMember]
public string company
{
get { return company; }
set { company = value; }
}
[DataMember]
public string ssno
{
get { return ssno; }
set { ssno = value; }
}
}
}
namespace Test1
{
public class Service1 : IService1
{
public void SetInsurance(InsuranceDetails insInfo)
{
Console.Write(insInfo.ToString());
}
}
}