protected void ValidateNameContainsOnlyValidChars(PluginProfileErrorCollection errors) { if (!ProfileDtoValidator.IsValid(Name)) { errors.Add(new PluginProfileError { FieldName = NameField, Message = "You can only use letters, numbers, space and underscore symbol in Mashup name" }); } }
private static void FixName(PluginProfileDto pluginProfile) { foreach (var profileNameChar in pluginProfile.Name.Distinct()) { if (ProfileDtoValidator.IsValid(profileNameChar.ToString())) { continue; } pluginProfile.Name = pluginProfile.Name.Replace(profileNameChar, '_'); } }