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
613 B
C#
32 lines
613 B
C#
using System.Data;
|
|
using Chloe;
|
|
using Chloe.PostgreSQL;
|
|
using Npgsql;
|
|
|
|
using Tool;
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
public class DbFactory
|
|
{
|
|
|
|
public static IDbContext GetContext
|
|
{
|
|
get
|
|
{
|
|
|
|
PostgreSQLContext context = new PostgreSQLContext(() =>
|
|
{
|
|
IDbConnection conn = new NpgsqlConnection(RfidSetting.Current.Db); //需要自己引入数据库驱动
|
|
|
|
return conn;
|
|
});
|
|
context.Options.ConvertToLowercase = true;
|
|
return context;
|
|
}
|
|
}
|
|
|
|
}
|
|
} |