/// <summary> /// Returns an existing, or a brand new method based on the details & parent class provided. /// </summary> /// <param name="details"></param> /// <param name="targetClass"></param> /// <returns></returns> private Entities.Method GetExistingOrNewMethod(LogDetails details, Entities.Class targetClass) { var existingMethod = _methodData.GetByNameAndClassId(targetClass.Id, details.Method); if (existingMethod == null) { existingMethod = new Entities.Method { ClassId = targetClass.Id, Name = details.Method }; existingMethod = _methodData.Save(existingMethod); } return(existingMethod); }