2021/09/09

Custom immutable class MoneyAmmount using class Immutable

Warrning: If u want to publish in your class some collection property u should use Immutable.Clone() method to prevent from casting fg ReadOnlyCollection to List by client and change real published collection objects states

2021/06/30

2021/04/22

How to get procedure name from sql script using regular expressions ?

Plain text:

public class ProcedureNameProvider : SqlObjectNameProvider { protected override string RegExPattern => @"((?!PROCEDURE).)*[\s]+PROCEDURE(\s*)(?[^\s]+)[\s]+"; public override string GetNameFromSqlScript(string sqlObjectDefinition) { Match match = new Regex(RegExPattern, RegexOptions.IgnoreCase).Match(sqlObjectDefinition); return match.Success ? NormalizeBrackets(match.Groups["proc_name"].Value) : String.Empty; } }