Simple OData Client - adding item to listOrder of items in classes: Fields, Properties, Constructors, MethodsRandomize a List<T>A generic list of anonymous classHow to get the list of properties of a class?Creating a comma separated list from IList<string> or IEnumerable<string>Using LINQ to remove elements from a List<T>How do I convert an enum to a list in C#?How to Sort a List<T> by a property in the objectUse LINQ to get items in one List<>, that are not in another List<>Why not inherit from List<T>?

How are one-time password generators like Google Authenticator different from having two passwords?

Is a diamond sword feasible?

Best species to breed to intelligence

The lexical root of the perfect tense forms differs from the lexical root of the infinitive form

How are Core iX names like Core i5, i7 related to Haswell, Ivy Bridge?

On what legal basis did the UK remove the 'European Union' from its passport?

Early arrival in Australia, early hotel check in not available

Was there a contingency plan in place if Little Boy failed to detonate?

Increase height of laser cut design file for enclosure

How old is Captain America at the end of "Avengers: Endgame"?

Can you book a one-way ticket to the UK on a visa?

Can the sorting of a list be verified without comparing neighbors?

Was the Highlands Ranch shooting the 115th mass shooting in the US in 2019

Guns in space with bullets that return?

Remove everything except csv file Bash Script

How could we transfer large amounts of energy sourced in space to Earth?

Noob at soldering, can anyone explain why my circuit won't work?

Why is it so slow when assigning a concatenated string to a variable in python?

Why does a C.D.F need to be right-continuous?

Why does TypeScript pack a Class in an IIFE?

What does it mean with the ask price is below the last price?

What is the airplane type in this formation seen above Eugene, Oregon?

Pre-1993 comic in which Wolverine's claws were turned to rubber?

Why use steam instead of just hot air?



Simple OData Client - adding item to list


Order of items in classes: Fields, Properties, Constructors, MethodsRandomize a List<T>A generic list of anonymous classHow to get the list of properties of a class?Creating a comma separated list from IList<string> or IEnumerable<string>Using LINQ to remove elements from a List<T>How do I convert an enum to a list in C#?How to Sort a List<T> by a property in the objectUse LINQ to get items in one List<>, that are not in another List<>Why not inherit from List<T>?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I have this OData structure:




"@odata.context":"[domain]:7048/NAV/ODataV4/$metadata#Collection(NAV.SalesOrder)","value":[

"@odata.etag":"W/"JzQ0O0pBQUFBQUNMQVFBQUFBSjcvekFBTVFCTkFERUFUZ0JFQUZNQUFBQUFBQT09NzsyMDY5MDI0MDsn"","Document_Type":"Order","No":"01M1NDS","Sell_to_Customer_Name":"","Quote_No":"","Sell_to_Address":"","Sell_to_Address_2":"","Sell_to_Post_Code":"","Sell_to_City":"","Sell_to_Contact_No":"","Sell_to_Contact":"","No_of_Archived_Versions":0,"Document_Date":"2019-03-20T00:00:00Z","Posting_Date":"2019-03-20T00:00:00Z","Order_Date":"2019-03-20T00:00:00Z","Due_Date":"0001-01-01T00:00:00Z","Requested_Delivery_Date":"0001-01-01T00:00:00Z","Promised_Delivery_Date":"0001-01-01T00:00:00Z","External_Document_No":"","Salesperson_Code":"","Campaign_No":"","Opportunity_No":"","Responsibility_Center":"","Assigned_User_ID":"","Job_Queue_Status":" ","Status":"Open","WorkDescription":"","Currency_Code":"","Prices_Including_VAT":false,"VAT_Bus_Posting_Group":"","Payment_Terms_Code":"","Payment_Method_Code":"","SelectedPayments":"No payment service is made available.","Transaction_Type":"","Shortcut_Dimension_1_Code":"","Shortcut_Dimension_2_Code":"","Payment_Discount_Percent":0,"Pmt_Discount_Date":"0001-01-01T00:00:00Z","Direct_Debit_Mandate_ID":"","ShippingOptions":"Default (Sell-to Address)","Ship_to_Code":"","Ship_to_Name":"","Ship_to_Address":"","Ship_to_Address_2":"","Ship_to_Post_Code":"","Ship_to_City":"","Ship_to_Country_Region_Code":"","Ship_to_Contact":"","Shipment_Method_Code":"","Shipping_Agent_Code":"","Shipping_Agent_Service_Code":"","Package_Tracking_No":"","BillToOptions":"Default (Customer)","Bill_to_Name":"","Bill_to_Address":"","Bill_to_Address_2":"","Bill_to_Post_Code":"","Bill_to_City":"","Bill_to_Contact_No":"","Bill_to_Contact":"","Location_Code":"","Shipment_Date":"2019-03-20T00:00:00Z","Shipping_Advice":"Partial","Outbound_Whse_Handling_Time":"","Shipping_Time":"","Late_Order_Shipping":false,"EU_3_Party_Trade":false,"Transaction_Specification":"","Transport_Method":"","Exit_Point":"","Area":"","Prepayment_Percent":0,"Compress_Prepayment":false,"Prepmt_Payment_Terms_Code":"","Prepayment_Due_Date":"0001-01-01T00:00:00Z","Prepmt_Payment_Discount_Percent":0,"Prepmt_Pmt_Discount_Date":"0001-01-01T00:00:00Z","Date_Filter":"''..03/22/19","ETag":"44;JAAAAACLAQAAAAJ7/zAAMQBNADEATgBEAFMAAAAAAA==7;20690240;"





and I need to insert new order to the property "value". Simple retrieval of the list is working:



var orders = await client
.For(Constants.Company).Key(Constants.CompanyName)
.NavigateTo("SalesOrder")
.FindEntriesAsync();


But adding an item to new list not working:



var product = await client
.For(Constants.Company).Key(Constants.CompanyName)
.NavigateTo<SalesOrder>("SalesOrder")
.Set(CreateSaleOrder(customerState))
.InsertEntryAsync();


Cause this error:



Microsoft.OData.ODataException:
A property with name 'Document_Type' was found when reading a top-level resource set. No properties other than the resource set property with the name 'value' are allowed.


I also try the solution with .Select and .Expand but nothing helps.










share|improve this question






























    0















    I have this OData structure:




    "@odata.context":"[domain]:7048/NAV/ODataV4/$metadata#Collection(NAV.SalesOrder)","value":[

    "@odata.etag":"W/"JzQ0O0pBQUFBQUNMQVFBQUFBSjcvekFBTVFCTkFERUFUZ0JFQUZNQUFBQUFBQT09NzsyMDY5MDI0MDsn"","Document_Type":"Order","No":"01M1NDS","Sell_to_Customer_Name":"","Quote_No":"","Sell_to_Address":"","Sell_to_Address_2":"","Sell_to_Post_Code":"","Sell_to_City":"","Sell_to_Contact_No":"","Sell_to_Contact":"","No_of_Archived_Versions":0,"Document_Date":"2019-03-20T00:00:00Z","Posting_Date":"2019-03-20T00:00:00Z","Order_Date":"2019-03-20T00:00:00Z","Due_Date":"0001-01-01T00:00:00Z","Requested_Delivery_Date":"0001-01-01T00:00:00Z","Promised_Delivery_Date":"0001-01-01T00:00:00Z","External_Document_No":"","Salesperson_Code":"","Campaign_No":"","Opportunity_No":"","Responsibility_Center":"","Assigned_User_ID":"","Job_Queue_Status":" ","Status":"Open","WorkDescription":"","Currency_Code":"","Prices_Including_VAT":false,"VAT_Bus_Posting_Group":"","Payment_Terms_Code":"","Payment_Method_Code":"","SelectedPayments":"No payment service is made available.","Transaction_Type":"","Shortcut_Dimension_1_Code":"","Shortcut_Dimension_2_Code":"","Payment_Discount_Percent":0,"Pmt_Discount_Date":"0001-01-01T00:00:00Z","Direct_Debit_Mandate_ID":"","ShippingOptions":"Default (Sell-to Address)","Ship_to_Code":"","Ship_to_Name":"","Ship_to_Address":"","Ship_to_Address_2":"","Ship_to_Post_Code":"","Ship_to_City":"","Ship_to_Country_Region_Code":"","Ship_to_Contact":"","Shipment_Method_Code":"","Shipping_Agent_Code":"","Shipping_Agent_Service_Code":"","Package_Tracking_No":"","BillToOptions":"Default (Customer)","Bill_to_Name":"","Bill_to_Address":"","Bill_to_Address_2":"","Bill_to_Post_Code":"","Bill_to_City":"","Bill_to_Contact_No":"","Bill_to_Contact":"","Location_Code":"","Shipment_Date":"2019-03-20T00:00:00Z","Shipping_Advice":"Partial","Outbound_Whse_Handling_Time":"","Shipping_Time":"","Late_Order_Shipping":false,"EU_3_Party_Trade":false,"Transaction_Specification":"","Transport_Method":"","Exit_Point":"","Area":"","Prepayment_Percent":0,"Compress_Prepayment":false,"Prepmt_Payment_Terms_Code":"","Prepayment_Due_Date":"0001-01-01T00:00:00Z","Prepmt_Payment_Discount_Percent":0,"Prepmt_Pmt_Discount_Date":"0001-01-01T00:00:00Z","Date_Filter":"''..03/22/19","ETag":"44;JAAAAACLAQAAAAJ7/zAAMQBNADEATgBEAFMAAAAAAA==7;20690240;"





    and I need to insert new order to the property "value". Simple retrieval of the list is working:



    var orders = await client
    .For(Constants.Company).Key(Constants.CompanyName)
    .NavigateTo("SalesOrder")
    .FindEntriesAsync();


    But adding an item to new list not working:



    var product = await client
    .For(Constants.Company).Key(Constants.CompanyName)
    .NavigateTo<SalesOrder>("SalesOrder")
    .Set(CreateSaleOrder(customerState))
    .InsertEntryAsync();


    Cause this error:



    Microsoft.OData.ODataException:
    A property with name 'Document_Type' was found when reading a top-level resource set. No properties other than the resource set property with the name 'value' are allowed.


    I also try the solution with .Select and .Expand but nothing helps.










    share|improve this question


























      0












      0








      0








      I have this OData structure:




      "@odata.context":"[domain]:7048/NAV/ODataV4/$metadata#Collection(NAV.SalesOrder)","value":[

      "@odata.etag":"W/"JzQ0O0pBQUFBQUNMQVFBQUFBSjcvekFBTVFCTkFERUFUZ0JFQUZNQUFBQUFBQT09NzsyMDY5MDI0MDsn"","Document_Type":"Order","No":"01M1NDS","Sell_to_Customer_Name":"","Quote_No":"","Sell_to_Address":"","Sell_to_Address_2":"","Sell_to_Post_Code":"","Sell_to_City":"","Sell_to_Contact_No":"","Sell_to_Contact":"","No_of_Archived_Versions":0,"Document_Date":"2019-03-20T00:00:00Z","Posting_Date":"2019-03-20T00:00:00Z","Order_Date":"2019-03-20T00:00:00Z","Due_Date":"0001-01-01T00:00:00Z","Requested_Delivery_Date":"0001-01-01T00:00:00Z","Promised_Delivery_Date":"0001-01-01T00:00:00Z","External_Document_No":"","Salesperson_Code":"","Campaign_No":"","Opportunity_No":"","Responsibility_Center":"","Assigned_User_ID":"","Job_Queue_Status":" ","Status":"Open","WorkDescription":"","Currency_Code":"","Prices_Including_VAT":false,"VAT_Bus_Posting_Group":"","Payment_Terms_Code":"","Payment_Method_Code":"","SelectedPayments":"No payment service is made available.","Transaction_Type":"","Shortcut_Dimension_1_Code":"","Shortcut_Dimension_2_Code":"","Payment_Discount_Percent":0,"Pmt_Discount_Date":"0001-01-01T00:00:00Z","Direct_Debit_Mandate_ID":"","ShippingOptions":"Default (Sell-to Address)","Ship_to_Code":"","Ship_to_Name":"","Ship_to_Address":"","Ship_to_Address_2":"","Ship_to_Post_Code":"","Ship_to_City":"","Ship_to_Country_Region_Code":"","Ship_to_Contact":"","Shipment_Method_Code":"","Shipping_Agent_Code":"","Shipping_Agent_Service_Code":"","Package_Tracking_No":"","BillToOptions":"Default (Customer)","Bill_to_Name":"","Bill_to_Address":"","Bill_to_Address_2":"","Bill_to_Post_Code":"","Bill_to_City":"","Bill_to_Contact_No":"","Bill_to_Contact":"","Location_Code":"","Shipment_Date":"2019-03-20T00:00:00Z","Shipping_Advice":"Partial","Outbound_Whse_Handling_Time":"","Shipping_Time":"","Late_Order_Shipping":false,"EU_3_Party_Trade":false,"Transaction_Specification":"","Transport_Method":"","Exit_Point":"","Area":"","Prepayment_Percent":0,"Compress_Prepayment":false,"Prepmt_Payment_Terms_Code":"","Prepayment_Due_Date":"0001-01-01T00:00:00Z","Prepmt_Payment_Discount_Percent":0,"Prepmt_Pmt_Discount_Date":"0001-01-01T00:00:00Z","Date_Filter":"''..03/22/19","ETag":"44;JAAAAACLAQAAAAJ7/zAAMQBNADEATgBEAFMAAAAAAA==7;20690240;"





      and I need to insert new order to the property "value". Simple retrieval of the list is working:



      var orders = await client
      .For(Constants.Company).Key(Constants.CompanyName)
      .NavigateTo("SalesOrder")
      .FindEntriesAsync();


      But adding an item to new list not working:



      var product = await client
      .For(Constants.Company).Key(Constants.CompanyName)
      .NavigateTo<SalesOrder>("SalesOrder")
      .Set(CreateSaleOrder(customerState))
      .InsertEntryAsync();


      Cause this error:



      Microsoft.OData.ODataException:
      A property with name 'Document_Type' was found when reading a top-level resource set. No properties other than the resource set property with the name 'value' are allowed.


      I also try the solution with .Select and .Expand but nothing helps.










      share|improve this question
















      I have this OData structure:




      "@odata.context":"[domain]:7048/NAV/ODataV4/$metadata#Collection(NAV.SalesOrder)","value":[

      "@odata.etag":"W/"JzQ0O0pBQUFBQUNMQVFBQUFBSjcvekFBTVFCTkFERUFUZ0JFQUZNQUFBQUFBQT09NzsyMDY5MDI0MDsn"","Document_Type":"Order","No":"01M1NDS","Sell_to_Customer_Name":"","Quote_No":"","Sell_to_Address":"","Sell_to_Address_2":"","Sell_to_Post_Code":"","Sell_to_City":"","Sell_to_Contact_No":"","Sell_to_Contact":"","No_of_Archived_Versions":0,"Document_Date":"2019-03-20T00:00:00Z","Posting_Date":"2019-03-20T00:00:00Z","Order_Date":"2019-03-20T00:00:00Z","Due_Date":"0001-01-01T00:00:00Z","Requested_Delivery_Date":"0001-01-01T00:00:00Z","Promised_Delivery_Date":"0001-01-01T00:00:00Z","External_Document_No":"","Salesperson_Code":"","Campaign_No":"","Opportunity_No":"","Responsibility_Center":"","Assigned_User_ID":"","Job_Queue_Status":" ","Status":"Open","WorkDescription":"","Currency_Code":"","Prices_Including_VAT":false,"VAT_Bus_Posting_Group":"","Payment_Terms_Code":"","Payment_Method_Code":"","SelectedPayments":"No payment service is made available.","Transaction_Type":"","Shortcut_Dimension_1_Code":"","Shortcut_Dimension_2_Code":"","Payment_Discount_Percent":0,"Pmt_Discount_Date":"0001-01-01T00:00:00Z","Direct_Debit_Mandate_ID":"","ShippingOptions":"Default (Sell-to Address)","Ship_to_Code":"","Ship_to_Name":"","Ship_to_Address":"","Ship_to_Address_2":"","Ship_to_Post_Code":"","Ship_to_City":"","Ship_to_Country_Region_Code":"","Ship_to_Contact":"","Shipment_Method_Code":"","Shipping_Agent_Code":"","Shipping_Agent_Service_Code":"","Package_Tracking_No":"","BillToOptions":"Default (Customer)","Bill_to_Name":"","Bill_to_Address":"","Bill_to_Address_2":"","Bill_to_Post_Code":"","Bill_to_City":"","Bill_to_Contact_No":"","Bill_to_Contact":"","Location_Code":"","Shipment_Date":"2019-03-20T00:00:00Z","Shipping_Advice":"Partial","Outbound_Whse_Handling_Time":"","Shipping_Time":"","Late_Order_Shipping":false,"EU_3_Party_Trade":false,"Transaction_Specification":"","Transport_Method":"","Exit_Point":"","Area":"","Prepayment_Percent":0,"Compress_Prepayment":false,"Prepmt_Payment_Terms_Code":"","Prepayment_Due_Date":"0001-01-01T00:00:00Z","Prepmt_Payment_Discount_Percent":0,"Prepmt_Pmt_Discount_Date":"0001-01-01T00:00:00Z","Date_Filter":"''..03/22/19","ETag":"44;JAAAAACLAQAAAAJ7/zAAMQBNADEATgBEAFMAAAAAAA==7;20690240;"





      and I need to insert new order to the property "value". Simple retrieval of the list is working:



      var orders = await client
      .For(Constants.Company).Key(Constants.CompanyName)
      .NavigateTo("SalesOrder")
      .FindEntriesAsync();


      But adding an item to new list not working:



      var product = await client
      .For(Constants.Company).Key(Constants.CompanyName)
      .NavigateTo<SalesOrder>("SalesOrder")
      .Set(CreateSaleOrder(customerState))
      .InsertEntryAsync();


      Cause this error:



      Microsoft.OData.ODataException:
      A property with name 'Document_Type' was found when reading a top-level resource set. No properties other than the resource set property with the name 'value' are allowed.


      I also try the solution with .Select and .Expand but nothing helps.







      c# .net odata






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 23 at 10:59







      Miroslav Novák

















      asked Mar 23 at 10:40









      Miroslav NovákMiroslav Novák

      104




      104






















          0






          active

          oldest

          votes












          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55312852%2fsimple-odata-client-adding-item-to-list%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55312852%2fsimple-odata-client-adding-item-to-list%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현