0

[Route("api/GetMenuBykidnew")] [HttpGet] public IHttpActionResult GetMenuBykidnew(int kid, string Username) {

        ApiBusiness ApiBus = new ApiBusiness();

        var result = ApiBus.GetKitchenMenubyKitchennew(kid, Username);
        return result;

    }

[ { "CartId": 1016, "OrderId": 124, "Username": "7887878787", "KitchenId": null, "CartAddedDate": "2020-01-21T00:00:00", "MenuId": 2055, "MenuName": "Veg Fried Rice", "MenuVariantId": 2055, "Rate": 91, "Quantity": 4, "ListPrice": 91, "ListGST": 4.55, "ListPacking": 5, "TotalPrice": 100.55, "MenuStatus": 0 } ]

Expected result

success:[ { "CartId": 1016, "OrderId": 124, "Username": "8892696780", "KitchenId": null, "CartAddedDate": "2020-01-21T00:00:00", "MenuId": 2055, "MenuName": "Veg Fried Rice", "MenuVariantId": 2055, "Rate": 91, "Quantity": 4, "ListPrice": 91, "ListGST": 4.55, "ListPacking": 5, "TotalPrice": 100.55, "MenuStatus": 0 } ]

  • change return result; with return Ok(new {success: result }); – Florim Maxhuni Jan 24 '20 at 15:35
  • [Route("api/GetMenuBykidnew")] [HttpGet] public HttpResponseMessage GetMenuBykidnew(int kid, string Username) { ApiBusiness ApiBus = new ApiBusiness(); var result = ApiBus.GetKitchenMenubyKitchennew(kid, Username); return new HttpResponseMessage() { Content = new StringContent(JArray.FromObject(result).ToString(), Encoding.UTF8, "application/json") }; } – saud imran Jan 24 '20 at 16:50
  • You dont need serialize just use this replace return result; with return Ok(new {success = result }); – Florim Maxhuni Jan 24 '20 at 23:02

0 Answers0