Postby BeeJay » Tue Oct 18, 2016 2:19 pm
I'm not sure about being able to expose as read only, but in one of my projects I made the conscious decision to not expose any of my persistent model classes and instead create a subschema of my model schema in which I create proxy classes to represent the data I want available to users of the C# API. This allowed for far greater control of what developers using the exposure could do in the system, and helped ensure critical information is not inadvertently leaked via the exposure. It also means you're free to make what would otherwise be breaking changes to exposed classes without impacting any C# consuming logic, assuming the exposed wrapper classes need no changes to the exposed properties & methods.
Hope that helps.
Cheers,
BeeJay.