HarmonyCore
HarmonyCore copied to clipboard
Support read only fields
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
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.