I have a data contract "StudentInformation" in my class library, something like this:
public class StudentInformation
{
public int StudentId { get; set; }
public bool CanChangeBus { get; set; }
public List<int> AvailableBuses { get; set; }
}
public class BusChangeRequestModel
{
public StudentInformation StudentInfo { get; set; }
...
...
}
public class BusChangeResponseModel
{
public StudentInformation StudentInfo { get; set; }
...
}
The Request model sends in StudentId, the class library processes the information and populates the properties "CanChangeBus" and "AvailableBuses", which are then returned in the response model.
I want to hide the properties "CanChangeBus" and "AvailableBuses" from the request model. If I change the setter of these properties to "internal" then the properties cannot be set by calling application but they are still visible. How can I hide them from calling application's instance of request model?