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.
32 lines
790 B
C#
32 lines
790 B
C#
using Chloe;
|
|
using Chloe.Infrastructure;
|
|
using Chloe.RDBMS.DDL;
|
|
using Chloe.SQLite;
|
|
using Chloe.SQLite.DDL;
|
|
using DNSD_DB.Mapper;
|
|
|
|
namespace DNSD_DB
|
|
{
|
|
public class SqlLiteTool
|
|
{
|
|
|
|
|
|
public static void CreateTable(string db)
|
|
{
|
|
DbConfiguration.UseTypeBuilders(typeof(RFIDConfigEntityMap));
|
|
DbConfiguration.UseTypeBuilders(typeof(RFIDLogsEntityMap));
|
|
|
|
|
|
|
|
IDbContext dbContext = new SQLiteContext(new SQLiteConnectionFactory(db));
|
|
new SQLiteTableGenerator(dbContext).CreateTables(TableCreateMode.CreateIfNotExists);
|
|
}
|
|
|
|
|
|
public static IDbContext GetDb(string db)
|
|
{
|
|
IDbContext dbContext = new SQLiteContext(new SQLiteConnectionFactory(db));
|
|
return dbContext;
|
|
}
|
|
}
|
|
} |