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
Ravindra Yadav
NA
35
1.3k
facing issue while creating request format to call api
Jul 17 2020 3:56 AM
Hi All,
Below code is my request format expected by api
{
utilityProductMatch(sites: [
{
utilityId: "96d83432",
constraints: [
"Commercial"
],
products: [
{
productId: YZZ
existingProductCategory: "test",
equivalentWatts: 500,
operatingHours: 1800,
fixtureType: "test1"
}
]
}
])
{
utilityId
}
}
currently i created request format is below, now i m not able to understand how i can i append my below request on "utilityProductMatch" as mention in above.
{
"sites": [
{
"utilityId": "19dbc535a",
"constraints": {
"commercial": true
},
"products": [
{
"productId": "XYZ",
"existingProductCategory": "test",
"equivalentWatts": 500,
"operatingHours": "1800",
"FixtureType": "Lamp"
}
]
}
]
}
my classes are below to create current request format
public
class
GetCreateRequest
{
public
List<Site> sites {
get
;
set
; }
}
public
class
Site
{
public
string
utilityId {
get
;
set
; }
public
ProgramConstraints constraints {
get
;
set
; }
public
List<Product> products {
get
;
set
; }
}
public
class
ProgramConstraints
{
public
bool
commercial
{
get
;
set
;
}
}
public
class
Product
{
public
string
productId {
get
;
set
; }
public
string
existingProductCategory {
get
;
set
; }
public
int
equivalentWatts {
get
;
set
; }
public
string
operatingHours {
get
;
set
; }
public
string
FixtureType {
get
;
set
; }
}
please suggest where i need to change in existing request format, so i will create request format as api expected.
Reply
Answers (
1
)
Question over Ninject, ASP.NET Identity and Entity Framework
How to round up the value end with Zero in asp.net mvc5?