I have class Session
in my WCF
, it has been generated from database, but I've made some changes on it using partial class
.
public partial class Session
{
[DataMemberAttribute]
public int K2
{
get { return 42; }
}
}
I've reloaded Service Reference
in my application, but when I try to download all Sessions
from WCF
I got following error:
$exception
{"An error occurred while receiving the HTTP response to http://localhost:60271/CloudService.svc
. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details."}
System.Exception {System.ServiceModel.CommunicationException}
For other classes like Exam
everithing works as always.
Update
The same with custom generated class:
[DataContractAttribute]
public class YoloClass
{
private int k = 42;
public int K
{
get { return k; }
}
[DataMemberAttribute]
public int K2
{
get { return 42; }
}
}
[OperationContract]
List<YoloClass> GetAllYoloClass();
public List<YoloClass> GetAllYoloClass()
{
var yololList = new List<YoloClass>();
for (var i = 0; i < 10; i++)
{
yololList.Add(new YoloClass());
}
return yololList;
}
On the Server site everytning looks ok, error apears in application immediately after GetAllYoloClass
in server ends.
Update
Something is wrong with my properties:
[DataContract]
public class YoloClass2
{
[DataMember]
public int K { get; set; }
}
works fine, but I need access to local private varibales...