Skip to content

Instantly share code, notes, and snippets.

@A2H111
Created March 16, 2017 23:45
Show Gist options
  • Save A2H111/09c00ce3c12a5687a6510cb759b40c0f to your computer and use it in GitHub Desktop.
Save A2H111/09c00ce3c12a5687a6510cb759b40c0f to your computer and use it in GitHub Desktop.
public class CustomerController : ApiController
{
//Creating dbcontext class for NorthwindDatabase
NorthwindEntities dbContext = new NorthwindEntities();
[HttpGet]
public IHttpActionResult GetCustomer()
{
//Here we will fetch the value from Customer Table
return Json(dbContext.Customers.Take(10).ToList());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment