HarmonyCore icon indicating copy to clipboard operation
HarmonyCore copied to clipboard

Support read only fields

Open SteveIves opened this issue 6 years ago • 1 comments

Need to implement support if repository says a field is read only. But can't exclude the setter. Refer to discussion in issue #36.

Aha! Link: https://synergex.aha.io/features/HC-79

SteveIves avatar Oct 18 '18 20:10 SteveIves

I have added code to the ODataModel template to throw an ApplicationException if the set method is called for read only properties. However this will result in a 500 "Internal Server Error" to be returned to the consumer, which is not appropriate. We need to figure out how to add some middle-ware to the Web API pipeline to transform the thrown exceptions into a 400 "Bad Request" response. This behavior is enabled via the ENABLE_READ_ONLY_PROPERTIES option.

SteveIves avatar Oct 20 '18 17:10 SteveIves