コード例 #1
0
ファイル: DeleteVerifier.cs プロジェクト: zhonli/odata.net
        protected override void Verify()
        {
            if (!Applies(Response))
            {
                return;
            }

            AstoriaRequest request = Response.Request;

            ResourceProperty property = request.GetPropertyFromQuery();

            if (property == null)
            {
                RequestUtil.GetAndVerifyStatusCode(Response.Workspace, request.URI, System.Net.HttpStatusCode.NotFound);
            }
            else
            {
                if (property.IsNavigation && property.OtherAssociationEnd.Multiplicity != Multiplicity.One)
                {
                    RequestUtil.GetAndVerifyStatusCode(Response.Workspace, request.URI, System.Net.HttpStatusCode.NoContent);
                }
                else
                {
                    // TODO: is this always right if its not a nav prop?
                    RequestUtil.GetAndVerifyStatusCode(Response.Workspace, request.URI, System.Net.HttpStatusCode.NotFound);
                }
            }
        }
コード例 #2
0
 public void OverrideIsOpenType(ResourceType type, bool value)
 {
     type.Facets.IsOpenType = value;
     RequestUtil.GetAndVerifyStatusCode(this,
                                        this.ServiceUri + "/SetIsOpenType?resourceTypeName='" + this.ContextNamespace + "." + type.Name + "'&value=" + value.ToString().ToLowerInvariant(),
                                        System.Net.HttpStatusCode.NoContent);
 }
コード例 #3
0
ファイル: InMemoryWorkspace.cs プロジェクト: zhonli/odata.net
 public override void RestoreData()
 {
     if (this.Settings.SkipDataPopulation)
     {
         return;
     }
     RequestUtil.GetAndVerifyStatusCode(this, this.ServiceUri + "/RestoreData", HttpStatusCode.NoContent);
 }