asp.net web api2 - Return true/false along with model data -


i'm attempting return true or false (in json) along model data. code builds , runs fine return on model data.

what i've tried reading other answers:

public iqueryable<book> getbooks() {     httpresponsemessage response = request.createresponse(httpstatuscode.ok);     return db.books;  } 

as can see, don't have greatest idea of i'm doing, through infinite wisom of community hope learn feat.

i create view model , returned controller

public class booksvm  {      public iqueryable<book> books { get; set; }      public bool booleanvalue { get; set; } } 

and in controller

public ihttpactionresult getbooks() {    var booksvm = new booksvm() { books = db.books, booleanvalue = true };    return ok(booksvm); } 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -