Nextended.CodeGen — API reference
The complete public surface of Nextended.CodeGen, generated from the compiled assembly.
Generated
This page is generated by tools/ApiRef from the compiled assembly — it includes members with no XML comment and therefore cannot drift from the code. Do not edit by hand.
Nextended.CodeGen
GenerationContext
class
No description.
Constructors
GenerationContext(AdditionalText additionalFile, GeneratorExecutionContext executionContext, MainConfig config)GenerationContext(AdditionalText additionalFile, SourceProductionContext productionContext, Compilation compilation, AnalyzerConfigOptionsProvider optionsProvider, MainConfig config)GenerationContext(NamespaceResolver namespaceResolver, GeneratorExecutionContext executionContext, MainConfig config)GenerationContext(NamespaceResolver namespaceResolver, SourceProductionContext productionContext, Compilation compilation, AnalyzerConfigOptionsProvider optionsProvider, MainConfig config)
Methods
AddSource(string hintName, string content) : voidReportDiagnostic(Diagnostic diagnostic) : void
Properties
AdditionalFile : AdditionalText { get; }Compilation : Compilation { get; }Config : MainConfig { get; }ExecutionContext : GeneratorExecutionContext? { get; }NamespaceResolver : NamespaceResolver { get; }OptionsProvider : AnalyzerConfigOptionsProvider { get; }ProductionContext : SourceProductionContext? { get; }
MainGenerator
class
No description.
Constructors
MainGenerator()
Methods
Initialize(IncrementalGeneratorInitializationContext context) : void
Fields
BuildId : Guid
Nextended.CodeGen.Config
ClassStructureCodeGenerationConfig
class
No description.
Constructors
ClassStructureCodeGenerationConfig()
Properties
ArrayGeneration : JsonArrayGeneration { get; set; }Ignore : string[] { get; set; }RootClassName : string { get; set; }SourceFile : string { get; set; }
CodeGenerationConfigBase
class
No description.
Constructors
CodeGenerationConfigBase()
Properties
CreateFileHeaders : bool { get; set; }
Set t true to generate file headers for the generated code files.DisableGeneration : bool { get; set; }
If set to true, the generation will be disabled.ModelType : GeneratedModelType { get; set; }
Type of the generated model. Can be one of the following: Class, Record, RecordStruct, Struct.Namespace : string { get; set; }
Default namespace for generated classes. Can be overwritten for DTOs in the AutoGenerateDtoAttribute. If null same as source will be used. (can be overwritten per class in Attribute layer)OutputPath : string { get; set; }
The path where the generated file will be saved. By default it's null and will be added to the generated code context. If a path is set, the file will be saved to that path and NOT added to the generated code context.Prefix : string { get; set; }
Default prefix for generated DTOs will only work when not set on Attribute layer. (can be overwritten per class in Attribute layer)Suffix : string { get; set; }
Default suffix for generated DTOs will only work when not set on Attribute layer.
CodeToDocsConfig
class
No description.
Constructors
CodeToDocsConfig()
Properties
DisableGeneration : bool { get; set; }FileIncludePattern : string { get; set; }InputFolder : string { get; set; }OutputPath : string { get; set; }SourceExportTypes : SourceExportType[] { get; set; }
DefaultMappingSettings
class
No description.
Constructors
DefaultMappingSettings()
Properties
MapWithClassMapper : bool? { get; set; }ToDtoMethodName : string { get; set; }ToSourceMethodName : string { get; set; }
DtoGenerationConfig
class
No description.
Constructors
DtoGenerationConfig()
Properties
AddContainingNamespaceUsings : bool? { get; set; }
Gets or sets a value indicating whether to includeusingdirectives for namespacesAddReferencedNamespacesUsings : bool? { get; set; }
Gets or sets a value indicating whether to includeusingdirectives for namespaces referenced by the properties of the generated DTOs.AlwaysGenerateFactoryOverloads : bool { get; set; }BaseType : string { get; set; }
Default Sets the base type for all the generated DTO class when not overriden.ComIdClassModifier : Modifier { get; set; }
Modifier for the generated COM id class.ComIdClassName : string { get; set; }
If Compatible is set to true then the generated classes are COM visible and fully com compatible. This setting represents the CLassName for the generated com id class that contains all required idsComIdClassPropertyFormat : string { get; set; }
Format string for the name of the Id property inside the generated com id class.CreateComments : bool { get; set; }CreateRegions : bool { get; set; }DeepProperties : bool { get; set; }
When set to true, properties of non generated base classes will also be included in the generated DTO.DefaultMappingSettings : DefaultMappingSettings { get; set; }
Default mapping generation settings.GenerateFactoryOverloadsForAbstract : bool { get; set; }GeneratePartial : bool { get; set; }GenerateToMethodsForAbstract : bool { get; set; }Interfaces : string[] { get; set; }
Adds interfaces to all generated DTO class and generated interface where setting is not overwritten.KeepAttributesOnGeneratedClass : bool { get; set; }
If set to true, the generated classes will keep the attributes from the original class.KeepAttributesOnGeneratedInterface : bool { get; set; }
If set to true, the generated interfaces will keep the attributes from the original class.MakeDtoAbstractWhenSourceIsAbstract : bool { get; set; }MappingOutputPath : string { get; set; }OneFilePerClass : bool { get; set; }PreClassString : string { get; set; }
A string that will be added before the generated class, useful for adding attributes or something.PreInterfaceString : string { get; set; }
A string that will be added before the generated interface, useful for adding attributes or something.Usings : string[] { get; set; }
ExcelGenerationConfig
class
No description.
Constructors
ExcelGenerationConfig()
Properties
ColumnMappings : IDictionary<string, string> { get; set; }DataStartRowIndex : int { get; set; }GenerateAllCollection : bool { get; set; }GenerateModelClass : bool { get; set; }GenerateStaticTable : bool { get; set; }HeaderRowIndex : int { get; set; }KeyColumn : string { get; set; }ModelClassPrefix : string { get; set; }OutputPath : string { get; set; }PropertyTypeOverrides : IDictionary<string, string> { get; set; }RootClassName : string { get; set; }SheetName : string { get; set; }SourceFile : string { get; set; }StaticClassName : string { get; set; }StaticPropertyPrefix : string { get; set; }
MainConfig
class
No description.
Constructors
MainConfig()
Properties
CodeToDocs : List<CodeToDocsConfig> { get; set; }DtoGeneration : DtoGenerationConfig { get; set; }ExcelGenerations : List<ExcelGenerationConfig> { get; set; }StructureGenerations : List<ClassStructureCodeGenerationConfig> { get; set; }
SourceExportType
enum
No description.
Values
HtmlMarkdownPlainTextvalue__
Nextended.CodeGen.Contracts
GeneratedFile
class
No description.
Constructors
GeneratedFile(string fileName, string ns, string content, CodeGenerationConfigBase config)GeneratedFile(string fileName, string ns, string content, string outputPath = null)
Properties
Content : string { get; }FileName : string { get; }Namespace : string { get; }OutputPath : string { get; set; }
The path where the generated file will be saved. By default it's null and will be added to the generated code context. If a path is set, the file will be saved to that path and NOT added to the generated code context.
ISourceSubGenerator
interface
No description.
Methods
Execute(GenerationContext context) : IEnumerable<GeneratedFile>
Properties
RequireConfig : bool { get; }
Nextended.CodeGen.Generators.CodeToText
CodeToTextGenerator
class
No description.
Constructors
CodeToTextGenerator()
Methods
Execute(GenerationContext context) : IEnumerable<GeneratedFile>
Properties
RequireConfig : bool { get; }
Nextended.CodeGen.Generators.DtoGeneration
DtoCodeGenerator
class
No description.
Constructors
DtoCodeGenerator(DtoGenerationConfig config, DtoGenerationSymbols symbols)
Methods
GenerateAllForType(INamedTypeSymbol type, List<INamedTypeSymbol> allTypes) : GeneratedFileGenerateClass(INamedTypeSymbol type, AutoGenerateDtoAttribute classAttr, Dictionary<string, INamedTypeSymbol> dtoTypeDict, bool addGeneric) : stringGenerateComIdFile(IEnumerable<INamedTypeSymbol> allTypes) : GeneratedFileGenerateEnum(INamedTypeSymbol enumType, AutoGenerateDtoAttribute classAttr, Dictionary<string, INamedTypeSymbol> dtoTypeDict) : stringGenerateGuids() : stringGenerateInterface(INamedTypeSymbol type, AutoGenerateDtoAttribute classAttr, Dictionary<string, INamedTypeSymbol> dtoTypeDict, bool addGeneric) : stringGenerateMappingExtensions(List<INamedTypeSymbol> types) : IReadOnlyList<GeneratedFile>GenerateNamespaceFile(string ns, IEnumerable<INamedTypeSymbol> types, Dictionary<string, INamedTypeSymbol> dtoTypeDict) : GeneratedFileGetGuid(string className) : ValueTuple<string, string>
Properties
HasGuids : bool { get; }
DtoGenerationSymbols
class
No description.
Constructors
DtoGenerationSymbols()
Methods
BuildMappingTargetTypeString(ITypeSymbol type, bool toNet, Dictionary<string, INamedTypeSymbol> comTypes, DtoGenerationSymbols symbols) : stringCollect(Compilation c, DtoGenerationConfig config) : DtoGenerationSymbolsContainsDtoTypeRecursive(ITypeSymbol type, Dictionary<string, INamedTypeSymbol> comTypes) : boolFindTypesWithAttribute(Compilation compilation) : List<INamedTypeSymbol>FindTypesWithAttributeFromAllAssemblies(Compilation compilation, INamedTypeSymbol[] attributeTypes) : List<INamedTypeSymbol>GetBaseTypeString(INamedTypeSymbol type, AutoGenerateDtoAttribute classAttr, Dictionary<string, INamedTypeSymbol> dtoTypeDict, bool asInterface) : stringGetBaseTypeString(INamedTypeSymbol type, Dictionary<string, INamedTypeSymbol> dtoTypeDict, bool asInterface) : stringGetBaseTypeString(INamedTypeSymbol type, string baseTypeStr, Dictionary<string, INamedTypeSymbol> dtoTypeDict, bool asInterface) : stringGetBaseTypeString(INamedTypeSymbol type, string[] interfaces, Dictionary<string, INamedTypeSymbol> dtoTypeDict, bool asInterface) : stringGetClassCfgForType(ITypeSymbol type, Dictionary<string, INamedTypeSymbol> dtoTypeDict) : AutoGenerateDtoAttributeGetDtoClassName(ITypeSymbol type, AutoGenerateDtoAttribute attr, bool asInterface) : stringGetDtoProperties(INamedTypeSymbol type, INamedTypeSymbol ignoreAttr) : IEnumerable<IPropertySymbol>GetDtoPropertiesDeep(INamedTypeSymbol type, INamedTypeSymbol ignoreAttr) : IEnumerable<IPropertySymbol>GetDtoPropertyName(IPropertySymbol prop, GenerationPropertySettingAttribute info) : stringGetDtoPropertyType(IPropertySymbol prop, Dictionary<string, INamedTypeSymbol> comTypes, DtoGenerationSymbols symbols, bool asInterface) : stringGetGenericTypeParameters(INamedTypeSymbol type) : stringGetGenericTypeParameters(ITypeSymbol type) : stringGetNamespaceForProperty(IPropertySymbol property, Dictionary<string, INamedTypeSymbol> dtoTypeDict) : stringGetNamespacePrefixString(AutoGenerateDtoAttribute classCfg) : stringGetNamespacePrefixString(string namespace) : stringGetQualifiedDtoTypeName(ITypeSymbol type, Dictionary<string, INamedTypeSymbol> comTypes, DtoGenerationSymbols symbols, bool asInterfaceForNonGeneric) : stringGetReferencedNamespaces(INamedTypeSymbol type, Dictionary<string, INamedTypeSymbol> dtoTypeDict) : IEnumerable<string>GetToDtoMethodName(ISymbol type, AutoGenerateDtoAttribute attr) : stringGetToSourceMethodName(ISymbol type, AutoGenerateDtoAttribute attr) : stringGetUsings(IEnumerable<INamedTypeSymbol> types, Dictionary<string, INamedTypeSymbol> dtoTypeDict, AutoGenerateDtoAttribute autoGenAttr, DtoGenerationConfig cfg) : string[]GetUsings(INamedTypeSymbol type, Dictionary<string, INamedTypeSymbol> dtoTypeDict, AutoGenerateDtoAttribute autoGenAttr, DtoGenerationConfig cfg) : string[]IsDictionaryType(INamedTypeSymbol nts) : boolIsDtoEnumType(ITypeSymbol type, Dictionary<string, INamedTypeSymbol> comTypes) : boolIsDtoType(ITypeSymbol type, Dictionary<string, INamedTypeSymbol> comTypes) : boolIsSimpleEnumerableType(INamedTypeSymbol nts) : bool
Einfache Mengen-Typen (ohne Dictionary).PropertyInBaseType(IPropertySymbol prop, INamedTypeSymbol baseType, Dictionary<string, INamedTypeSymbol> dtoTypeDict) : boolRegionNameFor(INamedTypeSymbol type, AutoGenerateDtoAttribute autoGenAttr) : stringResolveInterfaceAccess(IPropertySymbol prop, AutoGenerateDtoAttribute classAttr, DtoGenerationSymbols symbols) : InterfacePropertyTrimNullableSuffix(string typeName) : string
Hilfsroutine für Cast-Typnamen in expliziten Interface-Settern (Suffix '?' entfernen).
Properties
Config : DtoGenerationConfig { get; }
Fields
AutoGenerateDto : INamedTypeSymbolGenerateBeforeAndAfterAssignPartialsInMapping : INamedTypeSymbolIgnore : INamedTypeSymbolPropertySetting : INamedTypeSymbol
DtoGenerator
class
No description.
Constructors
DtoGenerator()DtoGenerator(DtoGenerationConfig config)
Methods
Execute(Compilation compilation) : IEnumerable<GeneratedFile>Execute(GenerationContext context) : IEnumerable<GeneratedFile>Execute(GeneratorExecutionContext context) : IEnumerable<GeneratedFile>
Properties
RequireConfig : bool { get; }
Nextended.CodeGen.Generators.ExcelGeneration
ExcelStructureGenerator
class
No description.
Constructors
ExcelStructureGenerator()
Methods
Execute(GenerationContext context) : IEnumerable<GeneratedFile>
Properties
RequireConfig : bool { get; }
Nextended.CodeGen.Generators.StructureGeneration
JsonClassGenerator
static class
No description.
Methods
GenerateClasses(string json, ClassStructureCodeGenerationConfig config) : string
StructureGenerator
class
No description.
Constructors
StructureGenerator()
Methods
Execute(GenerationContext context) : IEnumerable<GeneratedFile>
Properties
RequireConfig : bool { get; }
XmlClassGenerator
static class
No description.
Methods
GenerateClasses(string xml, ClassStructureCodeGenerationConfig config) : string
Nextended.CodeGen.Helper
NamespaceResolver
class
No description.
Constructors
NamespaceResolver(AdditionalText file, Compilation compilation, AnalyzerConfigOptionsProvider optionsProvider)NamespaceResolver(AdditionalText file, GeneratorExecutionContext context)NamespaceResolver(string originFilePath, Compilation compilation, AnalyzerConfigOptionsProvider optionsProvider)NamespaceResolver(string originFilePath, GeneratorExecutionContext context)NamespaceResolver(string originFilePath, string fallBackRootNamespace, OptionsTryGetFunc optionsGetterFunc)
Methods
EnsurePathEndsWithDirectorySeparator(string path) : stringGetAbsolutePath(string path, string basePath = null) : stringGetRelativePath(string fromPath, string toPath) : stringResolve() : string
OptionsTryGetFunc
delegate
No description.
Constructors
OptionsTryGetFunc(object object, IntPtr method)
Methods
BeginInvoke(string key, out string value, AsyncCallback callback, object object) : IAsyncResultEndInvoke(out string value, IAsyncResult result) : boolInvoke(string key, out string value) : bool