Example #1
0
 /// <summary>Creates a new instance of the service operation.</summary>
 /// <param name="name">Name of the service operation.</param>
 /// <param name="resultKind">
 ///   <see cref="T:Microsoft.OData.Service.Providers.ServiceOperationResultKind" /> that is the kind of result expected from this operation.</param>
 /// <param name="resultType">
 ///   <see cref="T:Microsoft.OData.Service.Providers.ResourceType" /> that is the result of the operation.</param>
 /// <param name="resultSet">
 ///   <see cref="T:Microsoft.OData.Service.Providers.ResourceSet" /> that is the result of the operation.</param>
 /// <param name="method">Protocol method to which the service operation responds.</param>
 /// <param name="parameters">Ordered collection of <see cref="T:Microsoft.OData.Service.Providers.ServiceOperationParameter" /> objects that are parameters for the operation.</param>
 public ServiceOperation(string name, ServiceOperationResultKind resultKind, ResourceType resultType, ResourceSet resultSet, string method, IEnumerable <ServiceOperationParameter> parameters)
     : base(
         name,
         resultKind,
         ServiceOperation.GetReturnTypeFromResultType(resultType, resultKind),
         resultSet,
         null /*resultSetExpression*/,
         method,
         parameters,
         OperationParameterBindingKind.Never,
         OperationKind.ServiceOperation)
 {
     Debug.Assert(this.OperationParameters != null, "this.OperationParameters != null");
     if (this.OperationParameters == OperationParameter.EmptyOperationParameterCollection)
     {
         this.parameters = ServiceOperationParameter.EmptyServiceOperationParameterCollection;
     }
     else
     {
         this.parameters = new ReadOnlyCollection <ServiceOperationParameter>(this.OperationParameters.Cast <ServiceOperationParameter>().ToList());
     }
 }