Guest User

Untitled

a guest
Jan 23rd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. public JsonResult GetMessages()
  2. {
  3. using(FleetContext ctx = new FleetContext())
  4. {
  5. IEnumerable<string> messages = ctx.Insurers.AsQueryable().Cast<Insurer>().Select(x => x.Name).ToList();
  6. var dataOutput = Json(messages, JsonRequestBehavior.AllowGet);
  7. return dataOutput;
  8. }
  9. }
Add Comment
Please, Sign In to add comment