I need to set my Entity Framework connection string in context;
using System;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
public partial class DERSANEM_MASTEREntities : DbContext
{
public DERSANEM_MASTEREntities()
: base("")
{
}
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
throw new UnintentionalCodeFirstException();
}
public DbSet<sysdiagrams> sysdiagrams { get; set; }
public DbSet<T_HATA_LOG> T_HATA_LOG { get; set; }
public DbSet<T_MUSTERILER> T_MUSTERILER { get; set; }
}
You can modify the context class constructor, and pass the parameter of your string connection:
public DERSANEM_MASTEREntities(bool con = true) : base(ConnectionStringClass.GetConnectionString())
{...
}
o:
public DERSANEM_MASTEREntities()
: base("GetConnectionStringName")
{...
}