예제 #1
0
 /// <summary>
 /// Initializes a new instance of the SocialNetworkDbContext class.
 /// The Microsoft.EntityFrameworkCore.DbContext.OnConfiguring(Microsoft.EntityFrameworkCore.DbContextOptionsBuilder)
 /// method will still be called to allow further configuration of the options.
 /// </summary>
 /// <param name="configureConnection">The method to configure context options with connection string.</param>
 /// <param name="connection">The connection string.</param>
 /// <param name="optionsAction">The additional options action.</param>
 public SocialNetworkDbContext(Func <DbContextOptionsBuilder <SocialNetworkDbContext>, string, Action <DbContextOptionsBuilder <SocialNetworkDbContext> >, DbContextOptionsBuilder <SocialNetworkDbContext> > configureConnection, string connection, Action <DbContextOptionsBuilder <SocialNetworkDbContext> > optionsAction)
     : base(DbResourceEntityExtensions.CreateDbContextOptions(configureConnection, connection, optionsAction))
 {
 }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the SocialNetworkDbContext class.
 /// The Microsoft.EntityFrameworkCore.DbContext.OnConfiguring(Microsoft.EntityFrameworkCore.DbContextOptionsBuilder)
 /// method will still be called to allow further configuration of the options.
 /// </summary>
 /// <param name="configureConnection">The method to configure context options with connection string.</param>
 /// <param name="connection">The connection string.</param>
 public SocialNetworkDbContext(Func <DbContextOptionsBuilder, string, DbContextOptionsBuilder> configureConnection, string connection)
     : base(DbResourceEntityExtensions.CreateDbContextOptions <SocialNetworkDbContext>(configureConnection, connection))
 {
 }
예제 #3
0
 /// <summary>
 /// Initializes a new instance of the AccountDbContext class.
 /// The Microsoft.EntityFrameworkCore.DbContext.OnConfiguring(Microsoft.EntityFrameworkCore.DbContextOptionsBuilder)
 /// method will still be called to allow further configuration of the options.
 /// </summary>
 /// <param name="configureConnection">The method to configure context options with connection string.</param>
 /// <param name="connection">The database connection.</param>
 /// <param name="optionsAction">The additional options action.</param>
 public AccountDbContext(Func <DbContextOptionsBuilder <AccountDbContext>, DbConnection, Action <DbContextOptionsBuilder <AccountDbContext> >, DbContextOptionsBuilder <AccountDbContext> > configureConnection, DbConnection connection, Action <DbContextOptionsBuilder <AccountDbContext> > optionsAction)
     : base(DbResourceEntityExtensions.CreateDbContextOptions(configureConnection, connection, optionsAction))
 {
 }
예제 #4
0
 public static DbContextOptions CreateDbContextOptions <T>() where T : DbContext
 {
     return(DbResourceEntityExtensions.CreateDbContextOptions <T>(UseSqlServer, dbConn));
 }
예제 #5
0
 /// <summary>
 /// Initializes a new instance of the AccountDbContext class.
 /// The Microsoft.EntityFrameworkCore.DbContext.OnConfiguring(Microsoft.EntityFrameworkCore.DbContextOptionsBuilder)
 /// method will still be called to allow further configuration of the options.
 /// </summary>
 /// <param name="configureConnection">The method to configure context options with connection string.</param>
 /// <param name="connection">The database connection.</param>
 public AccountDbContext(Func <DbContextOptionsBuilder, DbConnection, DbContextOptionsBuilder> configureConnection, DbConnection connection)
     : base(DbResourceEntityExtensions.CreateDbContextOptions <AccountDbContext>(configureConnection, connection))
 {
 }