Example #1
0
 internal RequestDescription UpdateResponseVersionForPostMR(ResourceType resourceType, IDataService dataService)
 {
     if (this.PreferenceApplied != System.Data.Services.PreferenceApplied.NoContent)
     {
         this.InitializeVersion(dataService.OperationContext);
         bool considerEpmInVersion = WebUtil.IsAtomResponseFormat(dataService.OperationContext.Host.RequestAccept, RequestTargetKind.Resource, dataService.Configuration.DataServiceBehavior.MaxProtocolVersion, this.requestMaxVersion);
         ResourceSetWrapper targetContainer = this.LastSegmentInfo.TargetContainer;
         Version version = resourceType.GetMinimumResponseVersion(dataService, targetContainer, considerEpmInVersion);
         if (considerEpmInVersion && (version <= Version2Dot0))
         {
             this.VerifyAndRaiseActualResponseVersion(version, dataService);
             version = resourceType.GetMinimumResponseVersion(dataService, targetContainer, false);
         }
         this.VerifyAndRaiseResponseVersion(version, dataService);
     }
     return this;
 }
Example #2
0
 protected void UpdateAndCheckRequestResponseDSV(ResourceType resourceType, bool topLevel)
 {
     bool flag = this.ContentFormat == System.Data.Services.ContentFormat.Atom;
     if (flag)
     {
         Version requiredVersion = resourceType.EpmMinimumDataServiceProtocolVersion.ToVersion();
         this.RequestDescription.VerifyRequestVersion(requiredVersion, this.service);
     }
     if (topLevel && this.ResponseWillBeSent)
     {
         Version version2;
         bool considerEpmInVersion = WebUtil.IsAtomResponseFormat(this.Service.OperationContext.Host.RequestAccept, this.RequestDescription.TargetKind, this.Service.Configuration.DataServiceBehavior.MaxProtocolVersion, this.Service.OperationContext.Host.RequestMaxVersion);
         ResourceSetWrapper targetContainer = this.RequestDescription.LastSegmentInfo.TargetContainer;
         if (flag)
         {
             version2 = resourceType.GetMinimumResponseVersion(this.Service, targetContainer, considerEpmInVersion);
         }
         else
         {
             version2 = resourceType.GetMinimumResponseVersion(this.Service, targetContainer, considerEpmInVersion);
             if (considerEpmInVersion && (version2 <= System.Data.Services.RequestDescription.Version2Dot0))
             {
                 this.RequestDescription.VerifyAndRaiseActualResponseVersion(version2, this.service);
                 version2 = resourceType.GetMinimumResponseVersion(this.Service, targetContainer, false);
             }
         }
         this.RequestDescription.VerifyAndRaiseResponseVersion(version2, this.Service);
     }
 }