You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
788 B
C#

6 months ago
using Chloe;
6 months ago
using Chloe.Infrastructure;
6 months ago
using Chloe.RDBMS.DDL;
using Chloe.SQLite;
using Chloe.SQLite.DDL;
6 months ago
using DNSD_DB.Mapper;
6 months ago
namespace DNSD_DB
{
public class SqlLiteTool
{
public static void CreateTable(string db)
{
6 months ago
DbConfiguration.UseTypeBuilders(typeof(StudentMap));
6 months ago
DbConfiguration.UseTypeBuilders(typeof(RfidSettingMap));
6 months ago
IDbContext dbContext = new SQLiteContext(new SQLiteConnectionFactory(db));
new SQLiteTableGenerator(dbContext).CreateTables(TableCreateMode.CreateIfNotExists);
}
6 months ago
public static IDbContext GetDb(string db)
{
IDbContext dbContext = new SQLiteContext(new SQLiteConnectionFactory(db));
return dbContext;
}
6 months ago
}
}