I have a requirement where i have to modify the incoming message in Receive pipeline which i want to do using BRE Pipleline , I have written the Code in a console Application for Testing purpose but how to write a separate assembly and use in BRE Vocabulary
, I know how to use the BRE Pipeline to call the Polict but need help with .net assemble , Below is the code which i wrote and working
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
String sourceDirectory = @"C:\Console\New folder\In.txt";
String targetDirectory = @"C:\Console\New folder\Out.txt";
var all = File.ReadAllLines(sourceDirectory).ToList();
var dataLines = all.Where(l => Regex.IsMatch(l, @"^\d+"));
var lines = all.Take(2).Concat(dataLines).ToList();
File.WriteAllLines(targetDirectory, lines);
}
}
}
Appreciate the help
Sukra