Recent Changes
Recent Changes
One thing I noticed recently when working with Subsonic 3.0 and the T4 templates was that there was no way to detect if a stored procedure has nullable parameters. After a bit of research I found this msdn article
(?
.?)\s{1}as\s{1}"; RegexOptions options = RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture; MatchCollection matches = Regex.Matches(procedureText, regex, options); if (matches.Count > 0 && matches[0].Groups["Params"] != null) { Match match = matches[0]; arguments = match.Groups["Params"].ToString(); argumentArray = Regex.Split(arguments, ","); foreach (string sArgument in argumentArray) { MatchCollection paramMatches = Regex.Matches(sArgument, @"(?
@\S)", options); MatchCollection nullMatches = Regex.Matches(sArgument, @"(?
=\s*)", options); if (paramMatches.Count > 0 && paramMatches[0].Groups["ParamName"] != null) { bool isNullDefault = (nullMatches.Count > 0 && nullMatches[0].Groups["NullString"] != null); parameterNullibility.Add(paramMatches[0].Groups["ParamName"].ToString()); } } } return parameterNullibility; } b. Change SPPArams List
GetSPParams(string spName) { var result = new List
(); string[] restrictions = new string[3] { null, null, spName }; string procedureText; procedureText = GetStoredProcedureText(spName); List