1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-26 07:12:20 -05:00
bitwarden/src/Core/Services/Implementations/SsoConfigService.cs
2020-09-15 10:17:44 -04:00

30 lines
758 B
C#

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