Reputation: 3826
I'm using the settings below to include project "Soft.Data" in my Typewriter code generation.
But how do I exclude a specific folder (e.g. "ViewModels") from the code generation?
Template(Settings settings)
{
settings.IncludeProject("Soft.Data");
settings.OutputFilenameFactory = file =>
{
return $"{file.Name.Replace("ViewModel", "GenViewModel").Replace(".cs", ".ts")}";
};
}
Upvotes: 1
Views: 734
Reputation: 533
You can use a lambda filter in your template to exclude a namespace.
${
Template(Settings settings)
{
settings.IncludeProject("Soft.Data");
settings.OutputFilenameFactory = file =>
{
return $"{file.Name.Replace("ViewModel", "GenViewModel").Replace(".cs", ".ts")}";
};
}
}
$Classes(c => c.Namespace != "Soft.Data.ViewModels")[
...
]
Upvotes: 3