Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
public JsonResult GetMessages()
using(FleetContext ctx = new FleetContext())
IEnumerable<string> messages = ctx.Insurers.AsQueryable().Cast<Insurer>().Select(x => x.Name).ToList();
var dataOutput = Json(messages, JsonRequestBehavior.AllowGet);
return dataOutput;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment