Last active
February 13, 2019 07:50
-
-
Save nishanc/f5d28e0d83e7693720e7735f957462c4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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