1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-04 01:22:50 -05:00

Stub out EF repo base with user repo

This commit is contained in:
Kyle Spearrin
2020-01-08 20:28:16 -05:00
parent 9caaab0537
commit 7c5be176fa
9 changed files with 243 additions and 1 deletions

View File

@ -20,6 +20,7 @@ using System;
using System.IO;
using SqlServerRepos = Bit.Core.Repositories.SqlServer;
using PostgreSqlRepos = Bit.Core.Repositories.PostgreSql;
using EntityFrameworkRepos = Bit.Core.Repositories.EntityFramework;
using NoopRepos = Bit.Core.Repositories.Noop;
using System.Threading.Tasks;
using TableStorageRepos = Bit.Core.Repositories.TableStorage;
@ -32,6 +33,7 @@ using System.Linq;
using System.Security.Cryptography.X509Certificates;
using Bit.Core.Utilities;
using Serilog.Context;
using AutoMapper;
namespace Bit.Core.Utilities
{
@ -41,7 +43,9 @@ namespace Bit.Core.Utilities
{
if(!string.IsNullOrWhiteSpace(globalSettings.PostgreSql?.ConnectionString))
{
services.AddSingleton<IUserRepository, PostgreSqlRepos.UserRepository>();
services.AddAutoMapper(typeof(EntityFrameworkRepos.UserRepository));
services.AddDbContext<EntityFrameworkRepos.DatabaseContext>();
services.AddSingleton<IUserRepository, EntityFrameworkRepos.UserRepository>();
}
else
{