You can use like below (this is a sample).
Global.asax.cs
protected void Application_Start()
{
DataCatalog.ConnectionString = ConfigurationManager.ConnectionStrings["PawLoyalty"].ConnectionString;
}
Web.config
<connectionStrings>
<add name="PawLoyalty" connectionString="Server=.;database=PawLoyalty;Trusted_connection=true;pooling=true;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
</connectionStrings>
DataCatalog.cs
public class DataCatalog : DbContext
{
public static string ConnectionString { get; set; }
public DataCatalog()
: base(ConnectionString)
{
}
}
I hope this will help to you.