Entity Framework how to access the data model without saving the credentials and settings in the app.config

1

Please cooperate with the following problem:

Always work with EF EDMX, when creating the floor model, type the options "Yes, include confidential data in the connection string" and also the "Save connection settings in App.Config as:", but in this In this case I must do the opposite (without ticking the two options mentioned above), like this:

Well the model is generated normally, but now how do I change the connection string and how do I access the tables, views, procedures, etc ???

Note. The EF version is 6.x

Thanks in advance.

    
asked by RSillerico 03.03.2017 в 20:39
source

1 answer

1

I use this in EF4:

In Modelo.Context.cs

public DataBaseEntities(string connectionString )
            : base(connectionString)
        {
        }

Where DataBaseEntities is the name of your entity through which you access the DB. connectionString is a connection string, I generate it with EntityConnectionStringBuilder.

    
answered by 06.03.2017 в 18:09