mirror of
https://github.com/bitwarden/server.git
synced 2025-04-22 13:35:10 -05:00
32 lines
937 B
C#
32 lines
937 B
C#
using System;
|
|
using Dapper;
|
|
|
|
namespace Bit.Core.Repositories
|
|
{
|
|
public abstract class BaseRepository
|
|
{
|
|
static BaseRepository()
|
|
{
|
|
SqlMapper.AddTypeHandler(new DateTimeHandler());
|
|
}
|
|
|
|
public BaseRepository(string connectionString, string readOnlyConnectionString)
|
|
{
|
|
if(string.IsNullOrWhiteSpace(connectionString))
|
|
{
|
|
throw new ArgumentNullException(nameof(connectionString));
|
|
}
|
|
if(string.IsNullOrWhiteSpace(readOnlyConnectionString))
|
|
{
|
|
throw new ArgumentNullException(nameof(readOnlyConnectionString));
|
|
}
|
|
|
|
ConnectionString = connectionString;
|
|
ReadOnlyConnectionString = readOnlyConnectionString;
|
|
}
|
|
|
|
protected string ConnectionString { get; private set; }
|
|
protected string ReadOnlyConnectionString { get; private set; }
|
|
}
|
|
}
|