mercredi 2 septembre 2015

405 error in ASP.NET WEB API

I have two methods with the same parameters but i have made the 'Route' on top of each. But still i am getting a conflict saying "The requested resource does not support http method 'GET'."

[HttpGet]
            [Route("api/Values/GetDateList/{movieId}")]
            public List<Show> GetDateList(int movieId)
            {
                var DateList = BMSDatabase.Query<Show>("SELECT DISTINCT Date FROM Show WHERE MovieID = " + movieId).ToList<Show>();
                return DateList;
            }


            [HttpGet]
            [Route("api/Values/GetReservedSeats/{id}")]
            public List<Ticket> GetReservedSeats(int id)
            {
                var ReservedSeatList = BMSDatabase.Query<Ticket>("SELECT TicketNumbers from Ticket where ID = " + id).ToList<Ticket>();
                return ReservedSeatList;
            }

Kindly Resolve. Thank you in advace




Aucun commentaire:

Enregistrer un commentaire