Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
XML
Hi, everyone, can someone help me to post the class from windows phone to webservices, using entity6, this is my server code



 [ResponseType(typeof(wizre))]
        public async Task<IHttpActionResult> Postwizre(string o)
        {
            wizre reok = JsonConvert.DeserializeObject<wizre>(o);
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            db.wizres.Add(reok);

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (wizreExists(reok.devid))
                {
                    return Conflict();
                }
                else
                {
                    throw;
                }
            }

            return CreatedAtRoute("DefaultApi", new { id = reok.devid }, reok);
        }
</pre>



my class model is:
 class wizre
    {
        public string devid { get; set; }
        public string com { get; set; }
        public byte[] im1 { get; set; }
        public byte[] im2 { get; set; }
        public byte[] im3 { get; set; }
    }</pre>


Thanks
Posted
Updated 7-Mar-15 6:08am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900