void ConvertODataActionParametersToTypedModel(IModelTypeBuilder modelTypeBuilder, IEdmAction action, string controllerName)
        {
            for (var i = 0; i < ParameterDescriptions.Count; i++)
            {
                var description = ParameterDescriptions[i];
                var parameter   = description.ParameterDescriptor;

                if (parameter != null && parameter.ParameterType.IsODataActionParameters())
                {
                    var parameterType = modelTypeBuilder.NewActionParameters(Services, action, ApiVersion, controllerName);
                    description.ParameterDescriptor = new ODataModelBoundParameterDescriptor(parameter, parameterType);
                    break;
                }
            }
        }
Esempio n. 2
0
        void ConvertODataActionParametersToTypedModel(IModelTypeBuilder modelTypeBuilder, IEdmAction action, string controllerName)
        {
            Contract.Requires(modelTypeBuilder != null);
            Contract.Requires(action != null);
            Contract.Requires(controllerName != null);

            var apiVersion = new Lazy <ApiVersion>(() => EdmModel.GetAnnotationValue <ApiVersionAnnotation>(EdmModel).ApiVersion);

            for (var i = 0; i < ParameterDescriptions.Count; i++)
            {
                var description = ParameterDescriptions[i];
                var parameter   = description.ParameterDescriptor;

                if (parameter != null && parameter.ParameterType.IsODataActionParameters())
                {
                    description.ParameterDescriptor = new ODataModelBoundParameterDescriptor(parameter, modelTypeBuilder.NewActionParameters(serviceProvider, action, apiVersion.Value, controllerName));
                    break;
                }
            }
        }