SES-65 #5

Merged
s426134 merged 5 commits from SES-65 into master 2020-12-03 18:36:39 +01:00
2 changed files with 40 additions and 20 deletions
Showing only changes of commit 50a11e0434 - Show all commits

View File

@ -24,26 +24,7 @@ namespace SessionCompanion.Database
protected override void OnModelCreating(ModelBuilder builder) protected override void OnModelCreating(ModelBuilder builder)
{ {
base.OnModelCreating(builder); base.OnModelCreating(builder);
builder.Entity<User>().HasData( builder.Entity<User>().HasData(SeedData.SeedUsers());
s426135 marked this conversation as resolved Outdated

Przenieśmy to do osobnych plików, bo zacznie ię niedługo robić syfek jak ostatnio.

Przenieśmy to do osobnych plików, bo zacznie ię niedługo robić syfek jak ostatnio.
new
{
Id = 1,
Nickname = "Morwiec",
Password = "123"
},
new
{
Id = 2,
Nickname = "Cichoklepiec",
Password = "123"
},
new
{
Id = 3,
Nickname = "Ruletka",
Password = "123"
}
);
} }
} }
} }

View File

@ -0,0 +1,39 @@
using Microsoft.EntityFrameworkCore;
using SessionCompanion.Database.Tables;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SessionCompanion.Database
{
public class SeedData
{
static public List<User> SeedUsers()
{
List<User> users = new List<User>
{
new User
{
Id = 1,
Nickname = "Morwiec",
Password = "123"
},
new User
{
Id = 2,
Nickname = "Cichoklepiec",
Password = "123"
},
new User
{
Id = 3,
Nickname = "Ruletka",
Password = "123"
}
};
return users;
}
}
}