Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. How to post array of objects to oData

How to post array of objects to oData

Scheduled Pinned Locked Moved Web Development
sysadmindata-structurestutorial
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Asif Rehman
    wrote on last edited by
    #1

    currently EF do support posting single object (e.g {id: 1, partyCateg: 'Assetts' } )

    // POST: odata/tbl_PartyCateg
    public IHttpActionResult Post([FromBody] tbl_PartyCateg categs)
    {
    return Created(categs);
    }

    What I want is to send array of Objects. tbl_PartyCateg[]

    [
    {
    id: 11,
    PartyCateg: "SomeValue1"
    },
    {
    id: 11,
    PartyCateg: "SomeValue1"
    }
    ]

    When I post above data via postman I got empty categs on server side. Where I'm Wrong.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups