I'm encountering an issue with TypeScript where the callback function is only returning _proto in the response's .data property when I set private properties in C# and instantiate an object filled with constructed properties. Strangely, if the properties are public and constructor isn't used, the response's .data property is populated as expected. Here's a comparison:
public class ThisWorks{
public string MyProperty{get;set;}
}
Working example within application layer:
ThisWorks example = new ThisWorks();
example.MyProperty = myReflectedProperty;
return example;
On the other hand, this approach does not work:
public class ThisDoesNotWork{
private string MyPrivateProperty {get;set;}
public ThisDoesNotWork(string myPrivateProperty){
MyPrivateProperty = myPrivateProperty;
}
}
I'm trying to understand what could be causing this behavior. My TypeScript service remains unchanged, but for some reason, the data is not being transferred from the service call... Any assistance on this matter would be highly appreciated! Also, Serialization is NOT relevant to this particular problem.