From 3f4c0720e1e3421431e7baa20882a4a4512a7fab Mon Sep 17 00:00:00 2001 From: ivar Date: Sun, 19 Oct 2025 23:41:23 +0200 Subject: Initial --- src/Data/Seed.cs | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/Data/Seed.cs (limited to 'src/Data/Seed.cs') diff --git a/src/Data/Seed.cs b/src/Data/Seed.cs new file mode 100644 index 0000000..03bcdb2 --- /dev/null +++ b/src/Data/Seed.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using IOL.Fagprove.Data.Enums; +using IOL.Fagprove.Data.Models; +using IOL.Fagprove.Utilities; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata.Builders; + +namespace IOL.Fagprove.Data +{ + public class Seed + { + public class SeedUsers : IEntityTypeConfiguration + { + public void Configure(EntityTypeBuilder builder) + { + builder.HasData(new List + { + new User + { + Id = Guid.NewGuid(), + CreatedUtc = DateTime.UtcNow, + Email = "ivar@protektit.no", + Password = PasswordHasher.HashPassword("ivar123"), + Name = "Ivar Løvlie Administrator", + Role = UserRole.Administrator, + }, + new User + { + Id = Guid.NewGuid(), + CreatedUtc = DateTime.UtcNow, + Email = "ivarino@protektit.no", + Password = PasswordHasher.HashPassword("ivar123"), + Name = "Ivar Løvlie Standard", + Role = UserRole.Basic, + } + }); + } + } + } +} \ No newline at end of file -- cgit v1.3