summaryrefslogtreecommitdiffstats
path: root/src/Data/Seed.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Data/Seed.cs')
-rw-r--r--src/Data/Seed.cs41
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