/* Constructors */ /// <summary> /// Initializes a new instance of the <see cref="EveDbContext" /> class using /// conventions to create the name of the database to which a connection will /// be made. By convention the name is the full name (namespace + class name) /// of the derived context class. For more information on how this is used /// to create a connection, see the remarks section for <see cref="DbContext" />. /// </summary> public EveDbContext() { // By default, use the name of the current type (including derived // types) as the key for finding the connection string in the application // configuration, in order to follow EF naming conventions. string connectionStringLookup = this.GetType().FullName; this.directContext = new DirectEveDbContext(connectionStringLookup); }
/// <summary> /// Initializes a new instance of the <see cref="EveDbContext" /> class, /// using the specified <see cref="DirectEveDbContext" /> to provide access to the database. /// </summary> /// <param name="directContext"> /// The <see cref="DirectEveDbContext" /> which will be used to provide access to the database. /// </param> private EveDbContext(DirectEveDbContext directContext) { Contract.Requires(directContext != null, "The inner DirectEveDbContext cannot be null."); this.directContext = directContext; }