void setAbilityCastType(string abilityCastTypeString) { AbilityType abilityType = new AbilityType(); using(Dota2Entities ctx = new Dota2Entities()) { var abilityTp = (from p in ctx.AbilityType where p.Name == abilityCastTypeString select p).FirstOrDefault(); abilityType = abilityTp; } }
void setAbilityCastType(string abilityCastTypeString) { AbilityType abilityType = new AbilityType(); using(Dota2Entities ctx = new Dota2Entities()) { var abType = (from p in ctx.AbilityType where p.Name == abilityCastTypeString select p); } }
void setAbilityCastType(string abilityCastTypeString) { AbilityType abilityType = new AbilityType(); using(Dota2Entities ctx = new Dota2Entities()) { var abilityTp = (from p in ctx.AbilityType where p.Name == abilityCastTypeString select p).FirstOrDefault(); abilityType = abilityTp; } if (abilityType != null) this.skill.AbilityType = abilityType; else { //TODO Incluir este erro no log posteriormente throw new Exception("No AbilityType has been returned. AbilityType: " + abilityCastTypeString); } }
void setTargetAffectedType (string targetAffectedType) { AbilityType abilityType = new AbilityType(); using (Dota2Entities ctx = new Dota2Entities()) { var targetAffectedTp = (from p in ctx.AbilityType where p.Name == targetAffectedType select p).FirstOrDefault(); abilityType = targetAffectedTp; } if (abilityType != null) { this.skill.AbilityType = abilityType; this.skill.AbilityTypeId = abilityType.ID; } else { //TODO Incluir este erro no log posteriormente throw new Exception("No AbilityType has been returned. AbilityType: " + targetAffectedType); } }
void setAbilityCastType(string abilitiesCastTypeString) { AbilityType abilityType = new AbilityType(); string[] abilityTypeString = abilitiesCastTypeString.Split(','); using(Dota2Entities ctx = new Dota2Entities()) { var abilityTp = (from p in ctx.AbilityType where p.Name == abilitiesCastTypeString select p).FirstOrDefault(); abilityType = abilityTp; } if (abilityType != null) { this.skill.AbilityTypeId = abilityType.ID; } else { //TODO Incluir erro no log throw new Exception("No AbilityType has been returned. AbilityType: " + abilitiesCastTypeString); } }