-
Notifications
You must be signed in to change notification settings - Fork 0
/
SourceBuilderExtensions.cs
25 lines (25 loc) · 1.05 KB
/
SourceBuilderExtensions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
namespace MappingCloningExtensions;
internal static class SourceBuilderExtensions
{
public static void WriteMapExtension(this SourceCodeStringBuilder builder, Action<ICodeBlock> action, MapModel result)
{
builder.WriteLine("#nullable enable");
//don't do any usings. instead, go ahead and do the fully quantified namespaces always.
builder.WriteLine("namespace CommonBasicLibraries.AdvancedGeneralFunctionsAndProcesses.BasicExtensions;")
.WriteLine("public static partial class ModelExtensions")
.WriteCodeBlock(w =>
{
action.Invoke(w);
});
}
public static void WriteCloneExtension(this SourceCodeStringBuilder builder, Action<ICodeBlock> action)
{
builder.WriteLine("#nullable enable")
.WriteLine("namespace CommonBasicLibraries.AdvancedGeneralFunctionsAndProcesses.BasicExtensions;")
.WriteLine("public static partial class ModelExtensions")
.WriteCodeBlock(w =>
{
action.Invoke(w);
});
}
}