//start of interface implementation public void AddNewWeapon(WeaponDTO model) { System.Diagnostics.Debug.WriteLine("inside Add new weapon of WeaponService"); bool hasElement = false; if (model.Element.ToLower() != "none") { hasElement = true; } //check if weapon has element //find element id //add new Equipment_element if (ValidateWeaponAttributes(model)) { _weaponRepo.AddNewWeaponToDb(model); } if (hasElement) { //int weaponId = _weaponRepo.GetWeapon(model.Name).WeaponId; ElementDTO equipElement = new ElementDTO(); if (ValidateElementProperty(0, model.Element, model.ElementDamage, equipElement)) { _equipmentElementRepo.AddNewEquipmentElement(0, equipElement); } } //check is weapon has element and if element name exists //find if element name exists in element DB // _equipmentElementRepo.AddNewEquipmentElement(model.Name, model.Element, model.ElementDamage); }