Skip to content

Commit

Permalink
Faction Id shouldn't be Required (#150)
Browse files Browse the repository at this point in the history
- Faction Id should no longer be required
 - Fixed error message on the Background textbox on edit
  • Loading branch information
noremacskich authored Sep 17, 2024
1 parent 34cd275 commit 8892ff7
Show file tree
Hide file tree
Showing 17 changed files with 1,066 additions and 43 deletions.
4 changes: 2 additions & 2 deletions api/ExpressedRealms.DB/Characters/Character.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class Character : ISoftDelete
public byte IntelligenceId { get; set; }
public byte WillpowerId { get; set; }

public int FactionId { get; set; }
public int? FactionId { get; set; }

public int StatExperiencePoints { get; set; }

Expand All @@ -37,6 +37,6 @@ public class Character : ISoftDelete
public virtual StatLevel StrengthStatLevel { get; set; } = null!;
public virtual StatLevel IntelligenceStatLevel { get; set; } = null!;
public virtual StatLevel WillpowerStatLevel { get; set; } = null!;
public virtual ExpressionSection FactionInfo { get; set; } = null!;
public virtual ExpressionSection? FactionInfo { get; set; } = null!;
public virtual List<CharacterSkillsMapping> CharacterSkillsMappings { get; set; } = null!;
}
5 changes: 2 additions & 3 deletions api/ExpressedRealms.DB/Characters/CharacterConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void Configure(EntityTypeBuilder<Character> builder)
builder.Property(x => x.IntelligenceId).IsRequired().HasDefaultValue(1);
builder.Property(x => x.WillpowerId).IsRequired().HasDefaultValue(1);

builder.Property(x => x.FactionId).IsRequired().HasDefaultValue(1);
builder.Property(x => x.FactionId);

builder.Property(x => x.StatExperiencePoints).IsRequired().HasDefaultValue(72);

Expand Down Expand Up @@ -87,7 +87,6 @@ public void Configure(EntityTypeBuilder<Character> builder)
.HasOne(x => x.FactionInfo)
.WithMany(x => x.CharactersList)
.HasForeignKey(x => x.FactionId)
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
.OnDelete(DeleteBehavior.Restrict);
}
}
Loading

0 comments on commit 8892ff7

Please sign in to comment.