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 -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -