diff options
| author | ivar <i@oiee.no> | 2025-10-19 23:41:23 +0200 |
|---|---|---|
| committer | ivar <i@oiee.no> | 2025-10-19 23:41:23 +0200 |
| commit | 3f4c0720e1e3421431e7baa20882a4a4512a7fab (patch) | |
| tree | 734ca81d7d0841d8863e3f523ebba14c282dc681 /src/Data/Seed.cs | |
| download | fagprove-3f4c0720e1e3421431e7baa20882a4a4512a7fab.tar.xz fagprove-3f4c0720e1e3421431e7baa20882a4a4512a7fab.zip | |
Diffstat (limited to 'src/Data/Seed.cs')
| -rw-r--r-- | src/Data/Seed.cs | 41 |
1 files changed, 41 insertions, 0 deletions
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<User> + { + public void Configure(EntityTypeBuilder<User> builder) + { + builder.HasData(new List<User> + { + 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 |
