public AttributesCreator(int heroId, Dictionary<string, string> primaryStats) { attribute = new Attributes(); attribute.HeroId = heroId; attribute.Intelligence = primaryStats["Intelligence"]; attribute.Agility = primaryStats["Agility"]; attribute.Strength = primaryStats["Strength"]; attribute.Damage = primaryStats["Damage"]; attribute.MoveSpeed = primaryStats["Movespeed"]; attribute.Armor = primaryStats["Armor"]; using (Dota2Entities ctx = new Dota2Entities()) { try { ctx.Attributes.Add(this.attribute); ctx.SaveChanges(); Console.WriteLine("Primary Stats Created "); } catch (Exception e) { //TODO Adicionar ao log throw e; } } }
public AttributesCreator(int heroId, string agility, string intelligence, string strength, string damage, string moveSpeed, string armor) { attribute = new Attributes(); attribute.HeroId = heroId; attribute.Agility = agility; attribute.Intelligence = intelligence; attribute.Strength = strength; attribute.Damage = damage; attribute.MoveSpeed = moveSpeed; attribute.Armor = armor; }