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.
27 lines
634 B
C#
27 lines
634 B
C#
using Dapper;
|
|
using System.Data;
|
|
using System.Data.SqlClient;
|
|
|
|
namespace Estsh.Core.Dapper
|
|
{
|
|
public class DapperDbContext
|
|
{
|
|
private string connectionString;
|
|
private IDbConnection dbConnection { get; set; }
|
|
|
|
public DapperDbContext(string settings)
|
|
{
|
|
this.connectionString = settings;
|
|
DefaultTypeMap.MatchNamesWithUnderscores = true;
|
|
|
|
this.GetDbConnection();
|
|
}
|
|
|
|
public IDbConnection GetDbConnection()
|
|
{
|
|
this.dbConnection = new SqlConnection(this.connectionString);
|
|
return this.dbConnection;
|
|
}
|
|
}
|
|
}
|