Exemplo n.º 1
0
 public void ApplyConfiguration(DataServiceConfiguration configuration, DataServiceProviderWrapper provider)
 {
     if (this.Kind == OperationKind.ServiceOperation)
     {
         this.serviceOperationRights = configuration.GetServiceOperationRights(this.ServiceOperation);
     }
     else
     {
         this.serviceActionRights = configuration.GetServiceActionRights(this.ServiceAction);
     }
     if (((this.Kind == OperationKind.ServiceOperation) && ((this.serviceOperationRights & ~System.Data.Services.ServiceOperationRights.OverrideEntitySetRights) != System.Data.Services.ServiceOperationRights.None)) || ((this.Kind == OperationKind.Action) && (this.serviceActionRights != System.Data.Services.ServiceActionRights.None)))
     {
         if (this.operation.ResourceSet != null)
         {
             this.resourceSet = provider.TryResolveResourceSet(this.operation.ResourceSet.Name);
             if (this.resourceSet == null)
             {
                 throw new InvalidOperationException(System.Data.Services.Strings.OperationWrapper_OperationResourceSetNotVisible(this.Name, this.operation.ResourceSet.Name));
             }
         }
         else if (this.ResultSetPathExpression != null)
         {
             this.ResultSetPathExpression.InitializePathSegments(provider);
         }
     }
 }
Exemplo n.º 2
0
 public void ApplyConfiguration(DataServiceConfiguration configuration, DataServiceProviderWrapper provider)
 {
     if (this.Kind == OperationKind.ServiceOperation)
     {
         this.serviceOperationRights = configuration.GetServiceOperationRights(this.ServiceOperation);
     }
     else
     {
         this.serviceActionRights = configuration.GetServiceActionRights(this.ServiceAction);
     }
     if (((this.Kind == OperationKind.ServiceOperation) && ((this.serviceOperationRights & ~System.Data.Services.ServiceOperationRights.OverrideEntitySetRights) != System.Data.Services.ServiceOperationRights.None)) || ((this.Kind == OperationKind.Action) && (this.serviceActionRights != System.Data.Services.ServiceActionRights.None)))
     {
         if (this.operation.ResourceSet != null)
         {
             this.resourceSet = provider.TryResolveResourceSet(this.operation.ResourceSet.Name);
             if (this.resourceSet == null)
             {
                 throw new InvalidOperationException(System.Data.Services.Strings.OperationWrapper_OperationResourceSetNotVisible(this.Name, this.operation.ResourceSet.Name));
             }
         }
         else if (this.ResultSetPathExpression != null)
         {
             this.ResultSetPathExpression.InitializePathSegments(provider);
         }
     }
 }