mirror of
https://github.com/bitwarden/server.git
synced 2026-01-31 14:13:18 +08:00
26 lines
669 B
C#
26 lines
669 B
C#
using Bit.Infrastructure.EntityFramework.Models;
|
|
using Bit.Infrastructure.EntityFramework.Repositories;
|
|
|
|
namespace Bit.Seeder.Recipes;
|
|
|
|
public class OrganizationDomainRecipe(DatabaseContext db)
|
|
{
|
|
public void Seed(Guid organizationId, string domainName)
|
|
{
|
|
var domain = new OrganizationDomain
|
|
{
|
|
Id = Guid.NewGuid(),
|
|
OrganizationId = organizationId,
|
|
DomainName = domainName,
|
|
Txt = Guid.NewGuid().ToString("N"),
|
|
CreationDate = DateTime.UtcNow,
|
|
};
|
|
|
|
domain.SetVerifiedDate();
|
|
domain.SetLastCheckedDate();
|
|
|
|
db.Add(domain);
|
|
db.SaveChanges();
|
|
}
|
|
}
|