private bool ValidateElementProperty(int weaponId, string elementName, int elementDamage, ElementDTO newEquipElementAdd) { // add front end checking of uppertcase stirng bool isElementValid = false; IEnumerable <ElementDTO> elements = _elementRepo.GetAllElements().AsEnumerable <ElementDTO>(); //make sure element exists in elelment db using (var iterator = elements.GetEnumerator()) { while (!isElementValid && iterator.MoveNext()) { System.Diagnostics.Debug.WriteLine("iterate elements: " + iterator.Current.Name); if (elementName == iterator.Current.Name) { isElementValid = true; newEquipElementAdd.ElementId = iterator.Current.ElementId; newEquipElementAdd.Name = iterator.Current.Name; System.Diagnostics.Debug.WriteLine("found element"); System.Diagnostics.Debug.WriteLine(iterator.Current.ElementId); System.Diagnostics.Debug.WriteLine(iterator.Current.ElementDamage); System.Diagnostics.Debug.WriteLine('\n'); System.Diagnostics.Debug.WriteLine(newEquipElementAdd.ElementId); System.Diagnostics.Debug.WriteLine(newEquipElementAdd.ElementDamage); System.Diagnostics.Debug.WriteLine(weaponId); } } } System.Diagnostics.Debug.WriteLine("inside validateelement"); //System.Diagnostics.Debug.WriteLine(newEquipElementAdd.ElementId); //System.Diagnostics.Debug.WriteLine(newEquipElementAdd.ElementDamage); //System.Diagnostics.Debug.WriteLine(weaponId); return(true); }
public IEnumerable <ElementDTO> GetAllElements() { return(_elementRepository.GetAllElements()); }