Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hbulens/54920620db76c568ca07e6711359f3de to your computer and use it in GitHub Desktop.
Save hbulens/54920620db76c568ca07e6711359f3de to your computer and use it in GitHub Desktop.
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