Suppose I have a linq to sql class. I want to return the object datacontext throught wcf. I have already made the database unidirectional.I put the WCF works getString() just to demonstrate that the wcf service works if I comment out everything about the ToolboxDataContext.
public interface Database()
{
[OperationContract]
ToolboxDataContext getCtx();
[OperationContract]
string getString();
}
public class test: Database
public ToolboxDataContext getCtx()
{
ToolboxDataContext ctx = new ToolboxDataContext ();
return ctx;
}
public string getString()
{
return "WCF WORKS";
}
[DataContract]
public class Testing //my svc file
{
[DataMember]
public ToolboxDataContext ctx;
[DataMember ]
public string Id;
}