Skip to content

Instantly share code, notes, and snippets.

@corespider
Created August 7, 2020 11:03
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 corespider/3571e63b13418821f48973d95bf135b8 to your computer and use it in GitHub Desktop.
Save corespider/3571e63b13418821f48973d95bf135b8 to your computer and use it in GitHub Desktop.
ASP .NET Web API CRUD operation using Entity Framework- CustomerAPIContext
public class CustomerAPIContext : DbContext
{
// You can add custom code to this file. Changes will not be overwritten.
//
// If you want Entity Framework to drop and regenerate your database
// automatically whenever you change your model schema, please use data migrations.
// For more information refer to the documentation:
// http://msdn.microsoft.com/en-us/data/jj591621.aspx
public CustomerAPIContext() : base("name=CustomerAPIContext")
{
}
public System.Data.Entity.DbSet<CustomerAPI.Models.Customer> Customers { get; set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment