ООП
- 4 ответа
- 0 вопросов
3
Вклад в тег
class CsvParser:
def parse(self, file_name):
class XlsParser:
def parse(self, file_name);
{ 'csv': CsvParser(), 'xls': XlsParser(), 'xml': XmlParser() }
class ParserProvider:
def provide(file_name):
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlite("Filename=dbTest.db", options =>
{
options.MigrationsAssembly(Assembly.GetExecutingAssembly().FullName);
});
if (!optionsBuilder.IsConfigured)
{
optionsBuilder.UseSqlite("Filename=dbTest.db");
}
base.OnConfiguring(optionsBuilder);
}
var connection = new SqliteConnection("DataSource=:memory:");
connection.Open();
var options = new DbContextOptionsBuilder<MyDbContext>()
.UseSqlite(connection)
.Options;
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (!optionsBuilder.IsConfigured)
{
optionsBuilder.UseSqlite("Filename=dbTest.db", options =>
{
options.MigrationsAssembly(Assembly.GetExecutingAssembly().FullName);
});
}
base.OnConfiguring(optionsBuilder);
}