/// <summary> /// Column data type is nullabe /// </summary> private bool Determine_DataTypeNullable(DbColumn dbColumn) { if (dbColumn.IsArray(_patternProject.LanguageSettings.ArrayIdenticator)) { return(true); } var stringCompare = StringComparison.CurrentCulture; if (!_patternProject.LanguageSettings.KeywordsCaseSensitive) { stringCompare = StringComparison.InvariantCultureIgnoreCase; } foreach (var dataType in _patternProject.LanguageSettings.NullableDataTypes) { var type = "." + dataType; if (dbColumn.DataTypeDotNet.EndsWith(type, stringCompare)) { return(true); } if (dataType.Equals(dbColumn.DataTypeDotNet, stringCompare)) { return(true); } } return(false); }
private bool Determine_ExplicitCastDataType(DbColumn dbColumn) { if (dbColumn.IsArray(_patternProject.LanguageSettings.ArrayIdenticator)) { return(true); } var stringCompare = StringComparison.CurrentCulture; if (!_patternProject.LanguageSettings.KeywordsCaseSensitive) { stringCompare = StringComparison.InvariantCultureIgnoreCase; } // any type that has any dot (.) in it! if (dbColumn.DataTypeDotNet.IndexOf('.') != -1) { return(true); } foreach (var dataType in _patternProject.LanguageSettings.ExplicitCastDataTypes) { if (dataType.Equals(dbColumn.DataTypeDotNet, stringCompare)) { return(true); } } return(false); }