Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MyThing
- {
- public int MyThingId { get; set; }
- public int UserId { get; set; }
- public string Title { get; set; }
- public string Address { get; set; }
- public string Description { get; set; }
- public DateTime Date { get; set; }
- }
- public class MyThingDb : DbContext
- {
- // If I comment this constructor out the scaffolding works
- public MyThingDb()
- : base("DefaultConnection")
- {
- }
- public DbSet<MyThing> Things{ get; set; }
- }
- <connectionStrings>
- <add name="DefaultConnection" ... />
- </connectionStrings>
- <add name="MyContext" connectionString="Data Source=|DataDirectory|MyDatabase.sdf" providerName="System.Data.SqlServerCe.4.0" />
- public class MyContext : DbContext
- {
- public MyContext() : base("MyDatabase") { }...
- public MyThingDb()
- : base("name=MyContext")
- {
- }
- [Display(Name="Logo")]
- [DataType(DataType.Upload)]
- [NotMapped]
- public HttpPostedFileBase Logo { set; get; }
- public
- DbSet<MyThing> Things
- { get; set; }
- }
- //[DbConfigurationType(typeof(MySql.Data.Entity.MySqlEFConfiguration))]
- public class NameDbContext
- {}
Add Comment
Please, Sign In to add comment