You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Projet_Blazor/src/DemoGraphQL/DemoGraphQL.Server/Entities/Context/UserContextConfiguration.cs

39 lines
1.0 KiB

namespace DemoGraphQL.Server.Entities.Context
{
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
public class UserContextConfiguration : IEntityTypeConfiguration<User>
{
private Guid[] _ids;
public UserContextConfiguration(Guid[] ids)
{
_ids = ids;
}
public void Configure(EntityTypeBuilder<User> builder)
{
builder
.HasData(
new User
{
Id = _ids[0],
Username = "Armure",
Password="12345",
role = UserRoles.Admin,
inventory = null
},
new User
{
Id = _ids[1],
Username = "Rayhan",
Password = "123456",
role = UserRoles.User,
inventory = null
}
); ; ;
}
}
}