| Main | Add | Update |
|---|---|---|
![]() | ![]() | ![]() |
An empty template that includes the forms above can be downloaded here. A full running example can be downloaded here.
The standard example program uses a list as data store. It can not be adaptet like the following program with abstraction. It can be found in the LibraryManagement solution under _FormsNoAbstraction.
The example program with abstraction includes a modular IDataAccess which is implemented by different libraries as BookDataAccess with:
Book ListSQLite DatabaseEF CoreFile
The abstract ValidateBookDataAccess library implements the Validation of the Book objects. It can be found in the LibraryManagement solution under LibraryManagement.Access.
Implements a simple list in backend and is designed for testing purpose.
_bookDataAccess=newAccess.Memory.BookDataAccess();Data is saved in a SQLite database either with EFCore or with raw SQL. Can be used within every database that inherits from DbConnection and DbCommand (e.g. mSQL, MySQL, mariaDB, ...).
IConfigurationconfig=newConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()).AddJsonFile("appsettings.json").Build();// -> With native SQL (sqlite, mariadb, mysql, msql)_connection=newSqliteConnection(config.GetConnectionString("SQLiteConnectionString"));_bookDataAccess=newAccess.Db.BookDataAccess(_connection);// -> With EFCore_connection=newSqliteConnection(config.GetConnectionString("SQLiteCoreConnectionString"));DbContextOptionsBuilderbuilder=newDbContextOptionsBuilder<Access.Core.DataContext>().UseSqlite(_connection);_bookDataAccess=newAccess.Core.BookDataAccess(newAccess.Core.DataContext(builder.Options));Implements a file reader/writer for handling the list of books
_bookDataAccess=newAccess.File.BookDataAccess("Books.dat");R. GÄCHTER



