public void ExecuteInstance(ITaskItem item, List <string> outputFiles)
        {
            var configuration = new Configuration();

            Deserialize(item, configuration);
            var inputFile = item.GetMetadata("FullPath");

            ModelToCode.ProcessFile(configuration, inputFile,
                                    m => BuildEngine.LogMessageEvent(new BuildMessageEventArgs(m, "", "EdmxToEfCore", MessageImportance.Normal)),
                                    m => BuildEngine.LogWarningEvent(new BuildWarningEventArgs("", "", inputFile, 0, 0, 0, 0, m, "", "EdmxToEfCore")),
                                    outputFiles.Add
                                    );
        }
Example #2
0
        static int Main(string[] args)
        {
            if (args.Length != 2)
            {
                var exeName = Path.GetFileNameWithoutExtension(typeof(Program).Assembly.Location);
                Console.WriteLine(
                    $@"EDMX to EF Core code generator
(C) Hamish Milne 2018
Usage:
        {exeName} [input .edmx model] [output .cs file or format]
"
                    );
                return(1);
            }
            var inFile  = args[0];
            var outFile = args[1];

            ModelToCode.ProcessFile(
                new ModelToCode.Configuration {
                OutputPathPattern = outFile
            },
                inFile, Console.WriteLine, Console.WriteLine, p => { });
            return(0);
        }