public void ClassWithEnumFromUnrelatedClass() { var c = new Copier(); c.AddType(typeof(MockRequest)); c.AddType(typeof(OtherMockRequest)); c.AddType(typeof(MockResponse)); var r = c.Process(); Console.WriteLine(r); }
public void ServiceTest() { var settings = new CopierSettings(); settings.BaseTypesToRemove.Add(typeof(BaseServiceInstance <,>)); var c = new Copier(settings); c.LimitOutputToAssemblyOfType(typeof(TokenRequest)); c.AddType(typeof(TokenRequest)); var r = c.Process(); Console.WriteLine(r); }
public void BasicClassTest() { var c = new Copier(); //c.LimitOutputToAssemblyOfType(typeof(Common.Models.Root)); c.AddType(typeof(GenericBase)); c.AddType(typeof(Basic)); c.AddType(typeof(ServiceResponse <CompoundResponse>)); c.AddType(typeof(MockRequest)); c.AddType(typeof(OtherMockRequest)); c.AddType(typeof(MockResponse)); var r = c.Process(); Console.WriteLine(r); }
static void Main(string[] args) { var builder = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json"); IConfiguration config = new ConfigurationBuilder() .AddJsonFile("appsettings.json", true, true) .Build(); var startFolder = config["StartingFolder"]; var publishFolderRoot = config["PublishFolder"]; Console.WriteLine(startFolder); //need to look over the folders in the starting folder var folders = Directory.GetDirectories(startFolder); //var folders = new string[] {"/Users/louise/Documents/Photos/20200426"}; foreach (var folder in folders) { var justFolderName = Path.GetFileName(folder); var publishFolder = Path.Combine(publishFolderRoot, justFolderName); //Console.WriteLine($"{folder}-{publishFolder}"); if (!Directory.Exists(publishFolder)) { var exportFolder = Path.Combine(folder, "export"); if (Directory.Exists(exportFolder)) { //send it for processing var copier = new Copier(publishFolderRoot); copier.Process(exportFolder); //Console.WriteLine("processing"); } } } Console.WriteLine(config["PublishFolder"]); //var copier = new Copier(); //copier.Process("/Users/louise/Documents/Photos/20200403/export"); Console.WriteLine("Hello World!"); }
public void ServiceTestWithReplacementType() { var settings = new CopierSettings { ReplacementTypes = { { typeof(TokenDate), typeof(DateTime) }, { typeof(TokenString), typeof(string) }, } }; settings.BaseTypesToRemove.Add(typeof(BaseServiceInstance <,>)); var c = new Copier(settings); c.LimitOutputToAssemblyOfType(typeof(TokenRequest)); c.AddType(typeof(TokenRequest)); var r = c.Process(); Console.WriteLine(r); }
public string ModelDuplicator() { (string, string)replaceWith = ($"Gtt.Links.Core", $"Gtt.Links.Client"); var settings = new CopierSettings(); settings.BaseTypesToRemove.Add(typeof(BaseServiceInstance <,>)); settings.BaseTypesToRemove.Add(typeof(BaseStatefulServiceInstance <, , , ,>)); var mt = new Copier(settings) { AlwaysGetAndSet = true, ReplaceNamespace = replaceWith }; mt.LimitOutputToAssemblyOfType(typeof(HealthCheckRequest)); foreach (var instance in _instances) { mt.AddType(instance.RequestType); mt.AddType(instance.ResponseType); } return(mt.Process()); }