I have a c# console app that uses entity framework. In the app config file I define the connection string
<connectionStrings>
<add name="DefaultConnection" connectionString="Provider=Microsoft.ACE.OleDb.12.0;Data source={argument from Main function}" providerName="JetEntityFrameworkProvider" />
</connectionStrings>
My context.cs
public class SinergyContext : DbContext
{
public SinergyContext() : base("name=DefaultConnection") { }
public DbSet<RejectedData> RejectedErrors { get; set; }
}
My Program.cs
static void Main(string[] args)
{
// arg[0] contains the connection string data source
Is it possible to set the connection string in Program.cs file ?