Beispiel #1
0
    public void Configure(EntityTypeBuilder <Skill> builder)
    {
        builder.ToTable("Skill");
        //builder.HasIndex(t => t.Abbreviation).IsUnique();

        builder.HasData(SkillSeed.Data());
    }
Beispiel #2
0
        public static Skill MapSeedToEntity(SkillSeed skillSeed)
        {
            var skillEntity = new Skill();

            MapSeedToEntity(skillSeed, skillEntity);
            return(skillEntity);
        }
Beispiel #3
0
        public static void EnsureSeeded(this DndDmHelperContext context)
        {
            context.Classes.AddRange(ClassSeed.Seed(context));
            context.SaveChanges();

            context.Races.AddRange(RaceSeed.Seed(context));
            context.SaveChanges();

            context.BaseStats.AddRange(BaseStatSeed.Seed(context));
            context.SaveChanges();

            context.NoteTypes.AddRange(NoteTypeSeed.Seed(context));
            context.SaveChanges();

            context.Skills.AddRange(SkillSeed.Seed(context));
            context.SaveChanges();
        }
Beispiel #4
0
 public static void MapSeedToEntity(SkillSeed skillSeed, Skill skillEntity)
 {
     skillEntity.Action      = skillSeed.action;
     skillEntity.ArmorCheck  = skillSeed.armor_check;
     skillEntity.Description = HttpUtility.HtmlDecode(skillSeed.description);
     skillEntity.EpicUse     = HttpUtility.HtmlDecode(skillSeed.epic_use);
     skillEntity.FullText    = HttpUtility.HtmlDecode(skillSeed.full_text);
     skillEntity.Id          = skillSeed.Id;
     skillEntity.KeyAbility  = skillSeed.key_ability;
     skillEntity.Name        = skillSeed.name;
     skillEntity.Psionic     = skillSeed.psionic;
     skillEntity.Reference   = skillSeed.reference;
     skillEntity.Restriction = skillSeed.restriction;
     skillEntity.SkillCheck  = HttpUtility.HtmlDecode(skillSeed.skill_check);
     skillEntity.Special     = skillSeed.special;
     skillEntity.Subtype     = skillSeed.subtype;
     skillEntity.Synergy     = skillSeed.synergy;
     skillEntity.Trained     = skillSeed.trained;
     skillEntity.TryAgain    = skillSeed.try_again;
     skillEntity.Untrained   = skillSeed.untrained;
 }