You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HI @zpqrtbnk ,
On time when I was working with my extension for MB v4, I hit that issue I need split generation separation in to 2 separate files and in time of work on that I noticed to do that I need modify Our.ModelsBuilder.Building.Generator and I noticed we actually dont have way to hijack here as we dont register that in container and we dont have any event which would allow me to change that part:
var codeModel = CreateModels(modelsNamespace, files, (name, code) =>
{
var filename = Path.Combine(modelsDirectory, name + ".generated.cs");
File.WriteAllText(filename, code);
});
Which I would extend with additional option after as example:
var codeTransformation = CreateTransformation(modelsNamespace, files, (name, code) =>
{
var filename = Path.Combine(modelsDirectory, name + ".transformation.generated.cs");
File.WriteAllText(filename, code);
});
and later
if (bin != null)
{
// build
foreach (var file in Directory.GetFiles(modelsDirectory, "*.generated.cs"))
files[file] = File.ReadAllText(file);
var compiler = new Compiler(_options.LanguageVersion);
// FIXME what is the name of the DLL as soon as we accept several namespaces = an option?
compiler.Compile(codeModel.AssemblyName, files, bin);
compiler.Compile(codeTransformation.AssemblyName, files, bin);
}
The text was updated successfully, but these errors were encountered:
bielu
changed the title
v4: Generator should swappable / extendable
v4: Generator should be swappable / extendable
Oct 25, 2020
HI @zpqrtbnk ,
On time when I was working with my extension for MB v4, I hit that issue I need split generation separation in to 2 separate files and in time of work on that I noticed to do that I need modify Our.ModelsBuilder.Building.Generator and I noticed we actually dont have way to hijack here as we dont register that in container and we dont have any event which would allow me to change that part:
Which I would extend with additional option after as example:
and later
The text was updated successfully, but these errors were encountered: