TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Asim Jena
NA
81
29.9k
how to pass more than one parameter in web api
Aug 17 2018 3:43 AM
[Route("GetSubProduct/{paramone}/{paramtwo}")]
[HttpGet]
public HttpResponseMessage GetProductById(GetSubProduct request, [FromUri]int Ccode, [FromUri]int Pcode)
{
if (request == null)
{
request = new GetSubProduct();
}
if (ModelState.IsValid)
{
DataTable dt = new DataTable();
dt = new CategoryAppService().GetSubProduct(request,Ccode, Pcode);
if (dt != null && dt.Rows.Count > 0)
{
var listvalue = (from p in dt.AsEnumerable()
select new
{
sub_code = p.Field<int>("SUB_CODE"),
ctg_code = p.Field<int>("CTG_CODE"),
prd_code = p.Field<int>("PRD_CODE"),
sub_name = p.Field<string>("SUB_NAME"),
sub_img = p.Field<string>("SUB_IMG"),
quantity = p.Field<int>("QUANTITY"),
offer_price = p.Field<decimal>("OFFER_PRICE"),
sale_price = p.Field<decimal>("SALE_PRICE"),
flavour_type = p.Field<int>("FLAVOUR_TYPE"),
sub_type=p.Field<string>("SUB_TYPE"),
size=p.Field<string>("SIZE"),
description=p.Field<string>("DESCRIPTION")
}).ToList();
return Request.CreateResponse(HttpStatusCode.OK, listvalue);
}
else
{
return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
}
}
else
{
return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
}
}
Reply
Answers (
4
)
Plzz Solve In this code error
How to get the range between dates in sql server