1
0
mirror of https://github.com/bitwarden/server synced 2025-12-13 06:43:45 +00:00
Files
server/src/Infrastructure.Dapper/Repositories/BaseRepository.cs
Justin Baur 1e0182008b [PM-2943] Enable Nullable Repositories in Unowned Files (#4549)
* Enable Nullable In Unowned Repos

* Update More Tests

* Move to One If

* Fix Collections

* Format

* Add Migrations

* Move Pragma Annotation

* Add Better Assert Message
2024-07-24 09:48:09 -04:00

32 lines
870 B
C#

using Dapper;
#nullable enable
namespace Bit.Infrastructure.Dapper.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; }
}