I am writing a C# application that takes embedded SQL files and executes them using FluentMigrator; and I must find a way to strip my SQL of certain characters that cause FluentMigrator problems when it tries to execute. There are 3 ways of executing SQL through FM: Execute a file by name, execute an embedded resource by name, and a string whose contents is valid SQL.
Previously, I had tried to use the method of executing sql contained in a string, where I could strip out the bad characters before passing it to FM. Due to other constraints, I cannot go this route and must execute the SQL by giving the name of the embedded resource. The problem here is I cannot strip out the bad characters before execution by this method.
Is there a way to execute code that could remove the bad characters from my embedded resource files AT the time of build/compilation. I know there are build events, but they seem to be limited to command line functions. Can I do more?
Edit: an example of these characters would be "\r\n", "\n\r" and even a ";" alone on a line.