1
0
mirror of https://github.com/bitwarden/server.git synced 2024-12-03 14:03:33 +01:00
bitwarden-server/src/Infrastructure.Dapper/Repositories/BaseRepository.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
852 B
C#
Raw Normal View History

using Dapper;
namespace Bit.Infrastructure.Dapper.Repositories;
2022-08-29 22:06:55 +02:00
public abstract class BaseRepository
{
static BaseRepository()
2022-08-29 22:06:55 +02:00
{
SqlMapper.AddTypeHandler(new DateTimeHandler());
2022-08-29 22:06:55 +02:00
}
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;
}
2022-08-29 22:06:55 +02:00
protected string ConnectionString { get; private set; }
protected string ReadOnlyConnectionString { get; private set; }
}