IDEs and plugins:
Frameworks:
- Entity Framework Core 6 (for SQLite)
Frameworks are available via NuGET Package Manager.
Application is based on multitier architecture:
- UI Layer
- Service Layer
- Business Layer
- Data Access Layer
I used Entity Framework Core and Code First approach to create model as shown above. Here's my DbContext
with OnConfiguring()
method:
public ResDbContext()
{
Batteries.Init();
Database.EnsureCreated();
}
It's neccessary to use Batteries.Init()
for EF Core.
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
var connectionStringBuilder = new SqliteConnectionStringBuilder { DataSource = "Researchers.db" };
var connectionString = connectionStringBuilder.ToString();
var connection = new SqliteConnection(connectionString);
optionsBuilder.UseSqlite(connection);
}
Comparing to Entity Framework you don't have to modify config files for connection string so you basically just use OnConfiguring()
method for it.