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#

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