Skip to content

Instantly share code, notes, and snippets.

@nishanc
Last active February 13, 2019 07:50
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 nishanc/f5d28e0d83e7693720e7735f957462c4 to your computer and use it in GitHub Desktop.
Save nishanc/f5d28e0d83e7693720e7735f957462c4 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Web;
using MySql.Data.Entity;
namespace MySQLCodeFirst.Models
{
[DbConfigurationType(typeof(MySqlEFConfiguration))]
public class DataContext : DbContext
{
public DataContext()
: base("DefaultConnection")
{
this.Configuration.ValidateOnSaveEnabled = false;
}
//Your model classes should be added as DbSets
public DbSet<User> Users { get; set; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment