Read Only C# Exposure
Posted: Tue Oct 18, 2016 9:45 am
by StevenQuickGS1
Is it possible to expose classes in a schema with a read only access rather than read/write with the c# exposure?
Re: Read Only C# Exposure
Posted: Tue Oct 18, 2016 2:19 pm
by BeeJay
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.