OdcmMethod should expose IEdmOperation.IsFunction()
Closed this issue · 2 comments
Hi there,
Currently OdcmMethod hides IEdmOperation.IsFunction(), and exposes an IsComposable property:
https://github.com/Microsoft/Vipr/blob/master/src/Readers/Vipr.Reader.OData.v4/OdcmReader.cs#L463
But no every function is composable, in fact by default (according to OData Specs) functions are not composable (but they're still a function).
It would be better to expose an IsFunction property along with the IsComposable property.
Something like this:
var odcmMethod = new OdcmMethod(operation.Name, odcmClass.Namespace)
{
IsFunction = operation.IsFunction(),
IsComposable = ((IEdmFunction)operation).IsComposable,
IsBoundToCollection = isBoundToCollection,
Verbs = operation.IsAction() ? OdcmAllowedVerbs.Post : OdcmAllowedVerbs.Any,
Class = odcmClass
};
What do you think?
Functions are a very strong OData-ism, in my opinion. We tried to decompose the distinction between functions and Actions into OdcmMethod.AllowedVerbs and OdcmParameter.CallingConvention. A Function would have the Verb set to Post and the CallingConvention to be Uri for all parameters. Is this insufficient to make the determination you are looking for? If not, a simple extension method atop OdcmMethod should do the trick. Thoughts?
due to no response and the previous concerns, closing. Model should have enough to handle already.