1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-22 13:35:10 -05:00
bitwarden/src/Core/Repositories/BaseRepository.cs
2019-01-15 21:55:42 -05:00

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; }
}
}