1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 15:42:48 -05:00

Created sso config service with save (#936)

This commit is contained in:
Kyle Spearrin
2020-09-15 10:17:44 -04:00
committed by GitHub
parent 692b3970af
commit 1c6c599b8d
6 changed files with 47 additions and 18 deletions

View File

@ -0,0 +1,29 @@
using System;
using System.Threading.Tasks;
using Bit.Core.Models.Table;
using Bit.Core.Repositories;
namespace Bit.Core.Services
{
public class SsoConfigService : ISsoConfigService
{
private readonly ISsoConfigRepository _ssoConfigRepository;
public SsoConfigService(
ISsoConfigRepository ssoConfigRepository)
{
_ssoConfigRepository = ssoConfigRepository;
}
public async Task SaveAsync(SsoConfig config)
{
var now = DateTime.UtcNow;
config.RevisionDate = now;
if (config.Id == default)
{
config.CreationDate = now;
}
await _ssoConfigRepository.UpsertAsync(config);
}
}
}