Skip to content

Commit

Permalink
refactor: Renamed the methods that create seed data
Browse files Browse the repository at this point in the history
  • Loading branch information
MrDave1999 committed Jan 4, 2023
1 parent d43a843 commit 68ab486
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 21 deletions.
22 changes: 11 additions & 11 deletions src/DataAccess/AppDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,20 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
AddSqlFunctions(modelBuilder);
modelBuilder.ApplyConfigurationsFromAssembly(Assembly.GetExecutingAssembly());

// Seed data.
modelBuilder.CreateRoles()
.CreateKinships()
.CreateAppointmentStatus()
.CreateWeekDays()
.CreateGenders();
// Create seed data.
modelBuilder.CreateDefaultRoles()
.CreateDefaultKinships()
.CreateDefaultAppointmentStatus()
.CreateDefaultWeekDays()
.CreateDefaultGenders();

if (_env.IsDevelopment())
{
modelBuilder.CreateGeneralTreatments()
.CreateSpecificTreatments()
.CreateOffices()
.CreateOfficeSchedules()
.CreateEmployeeSchedules()
modelBuilder.CreateDefaultGeneralTreatments()
.CreateDefaultSpecificTreatments()
.CreateDefaultOffices()
.CreateDefaultOfficeSchedules()
.CreateDefaultEmployeeSchedules()
.CreateDefaultUserAccounts();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public static class AppointmentStatusSeedData
{
public static ModelBuilder CreateAppointmentStatus(this ModelBuilder builder)
public static ModelBuilder CreateDefaultAppointmentStatus(this ModelBuilder builder)
{
builder.AddSeedData(
new AppointmentStatus
Expand Down
2 changes: 1 addition & 1 deletion src/Features/Dependents/Kinships/KinshipSeedData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public static class KinshipSeedData
{
public static ModelBuilder CreateKinships(this ModelBuilder builder)
public static ModelBuilder CreateDefaultKinships(this ModelBuilder builder)
{
builder.AddSeedData(
new Kinship
Expand Down
2 changes: 1 addition & 1 deletion src/Features/EmployeeSchedules/EmployeeScheduleSeedData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public static class EmployeeScheduleSeedData
{
public static ModelBuilder CreateEmployeeSchedules(this ModelBuilder builder)
public static ModelBuilder CreateDefaultEmployeeSchedules(this ModelBuilder builder)
{
builder.AddSeedData(
new EmployeeSchedule
Expand Down
2 changes: 1 addition & 1 deletion src/Features/GeneralTreatments/GeneralTreatmentSeedData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public static class GeneralTreatmentSeedData
{
public static ModelBuilder CreateGeneralTreatments(this ModelBuilder builder)
public static ModelBuilder CreateDefaultGeneralTreatments(this ModelBuilder builder)
{
builder.AddSeedData(
new GeneralTreatment
Expand Down
2 changes: 1 addition & 1 deletion src/Features/OfficeSchedules/OfficeScheduleSeedData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public static class OfficeScheduleSeedData
{
public static ModelBuilder CreateOfficeSchedules(this ModelBuilder builder)
public static ModelBuilder CreateDefaultOfficeSchedules(this ModelBuilder builder)
{
builder.AddSeedData(
new OfficeSchedule
Expand Down
2 changes: 1 addition & 1 deletion src/Features/Offices/OfficeSeedData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public static class OfficeSeedData
{
public static ModelBuilder CreateOffices(this ModelBuilder builder)
public static ModelBuilder CreateDefaultOffices(this ModelBuilder builder)
{
builder.AddSeedData(
new Office
Expand Down
2 changes: 1 addition & 1 deletion src/Features/PersonalInformation/Genders/GenderSeedData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public static class GenderSeedData
{
public static ModelBuilder CreateGenders(this ModelBuilder builder)
public static ModelBuilder CreateDefaultGenders(this ModelBuilder builder)
{
builder.AddSeedData(
new Gender
Expand Down
2 changes: 1 addition & 1 deletion src/Features/Roles/RoleSeedData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public static class RoleSeedData
{
public static ModelBuilder CreateRoles(this ModelBuilder builder)
public static ModelBuilder CreateDefaultRoles(this ModelBuilder builder)
{
builder.AddSeedData(
new Role
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public static class SpecificTreatmentSeedData
{
public static ModelBuilder CreateSpecificTreatments(this ModelBuilder builder)
public static ModelBuilder CreateDefaultSpecificTreatments(this ModelBuilder builder)
{
builder.AddSeedData(
// Ortodoncia/Brackets
Expand Down
2 changes: 1 addition & 1 deletion src/Features/WeekDays/WeekDaySeedData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public static class WeekDaySeedData
{
public static ModelBuilder CreateWeekDays(this ModelBuilder builder)
public static ModelBuilder CreateDefaultWeekDays(this ModelBuilder builder)
{
builder.AddSeedData(
new WeekDay
Expand Down

0 comments on commit 68ab486

Please sign in to comment.