Skip to content

Nextended.CodeGen — API reference

🇩🇪 Diese Seite auf Deutsch

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.

Back to the package page

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) : void
  • ReportDiagnostic(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 include using directives for namespaces
  • AddReferencedNamespacesUsings : bool? { get; set; }
    Gets or sets a value indicating whether to include using directives 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 ids
  • ComIdClassPropertyFormat : 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

  • Html
  • Markdown
  • PlainText
  • value__

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) : GeneratedFile
  • GenerateClass(INamedTypeSymbol type, AutoGenerateDtoAttribute classAttr, Dictionary<string, INamedTypeSymbol> dtoTypeDict, bool addGeneric) : string
  • GenerateComIdFile(IEnumerable<INamedTypeSymbol> allTypes) : GeneratedFile
  • GenerateEnum(INamedTypeSymbol enumType, AutoGenerateDtoAttribute classAttr, Dictionary<string, INamedTypeSymbol> dtoTypeDict) : string
  • GenerateGuids() : string
  • GenerateInterface(INamedTypeSymbol type, AutoGenerateDtoAttribute classAttr, Dictionary<string, INamedTypeSymbol> dtoTypeDict, bool addGeneric) : string
  • GenerateMappingExtensions(List<INamedTypeSymbol> types) : IReadOnlyList<GeneratedFile>
  • GenerateNamespaceFile(string ns, IEnumerable<INamedTypeSymbol> types, Dictionary<string, INamedTypeSymbol> dtoTypeDict) : GeneratedFile
  • GetGuid(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) : string
  • Collect(Compilation c, DtoGenerationConfig config) : DtoGenerationSymbols
  • ContainsDtoTypeRecursive(ITypeSymbol type, Dictionary<string, INamedTypeSymbol> comTypes) : bool
  • FindTypesWithAttribute(Compilation compilation) : List<INamedTypeSymbol>
  • FindTypesWithAttributeFromAllAssemblies(Compilation compilation, INamedTypeSymbol[] attributeTypes) : List<INamedTypeSymbol>
  • GetBaseTypeString(INamedTypeSymbol type, AutoGenerateDtoAttribute classAttr, Dictionary<string, INamedTypeSymbol> dtoTypeDict, bool asInterface) : string
  • GetBaseTypeString(INamedTypeSymbol type, Dictionary<string, INamedTypeSymbol> dtoTypeDict, bool asInterface) : string
  • GetBaseTypeString(INamedTypeSymbol type, string baseTypeStr, Dictionary<string, INamedTypeSymbol> dtoTypeDict, bool asInterface) : string
  • GetBaseTypeString(INamedTypeSymbol type, string[] interfaces, Dictionary<string, INamedTypeSymbol> dtoTypeDict, bool asInterface) : string
  • GetClassCfgForType(ITypeSymbol type, Dictionary<string, INamedTypeSymbol> dtoTypeDict) : AutoGenerateDtoAttribute
  • GetDtoClassName(ITypeSymbol type, AutoGenerateDtoAttribute attr, bool asInterface) : string
  • GetDtoProperties(INamedTypeSymbol type, INamedTypeSymbol ignoreAttr) : IEnumerable<IPropertySymbol>
  • GetDtoPropertiesDeep(INamedTypeSymbol type, INamedTypeSymbol ignoreAttr) : IEnumerable<IPropertySymbol>
  • GetDtoPropertyName(IPropertySymbol prop, GenerationPropertySettingAttribute info) : string
  • GetDtoPropertyType(IPropertySymbol prop, Dictionary<string, INamedTypeSymbol> comTypes, DtoGenerationSymbols symbols, bool asInterface) : string
  • GetGenericTypeParameters(INamedTypeSymbol type) : string
  • GetGenericTypeParameters(ITypeSymbol type) : string
  • GetNamespaceForProperty(IPropertySymbol property, Dictionary<string, INamedTypeSymbol> dtoTypeDict) : string
  • GetNamespacePrefixString(AutoGenerateDtoAttribute classCfg) : string
  • GetNamespacePrefixString(string namespace) : string
  • GetQualifiedDtoTypeName(ITypeSymbol type, Dictionary<string, INamedTypeSymbol> comTypes, DtoGenerationSymbols symbols, bool asInterfaceForNonGeneric) : string
  • GetReferencedNamespaces(INamedTypeSymbol type, Dictionary<string, INamedTypeSymbol> dtoTypeDict) : IEnumerable<string>
  • GetToDtoMethodName(ISymbol type, AutoGenerateDtoAttribute attr) : string
  • GetToSourceMethodName(ISymbol type, AutoGenerateDtoAttribute attr) : string
  • GetUsings(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) : bool
  • IsDtoEnumType(ITypeSymbol type, Dictionary<string, INamedTypeSymbol> comTypes) : bool
  • IsDtoType(ITypeSymbol type, Dictionary<string, INamedTypeSymbol> comTypes) : bool
  • IsSimpleEnumerableType(INamedTypeSymbol nts) : bool
    Einfache Mengen-Typen (ohne Dictionary).
  • PropertyInBaseType(IPropertySymbol prop, INamedTypeSymbol baseType, Dictionary<string, INamedTypeSymbol> dtoTypeDict) : bool
  • RegionNameFor(INamedTypeSymbol type, AutoGenerateDtoAttribute autoGenAttr) : string
  • ResolveInterfaceAccess(IPropertySymbol prop, AutoGenerateDtoAttribute classAttr, DtoGenerationSymbols symbols) : InterfaceProperty
  • TrimNullableSuffix(string typeName) : string
    Hilfsroutine für Cast-Typnamen in expliziten Interface-Settern (Suffix '?' entfernen).

Properties

  • Config : DtoGenerationConfig { get; }

Fields

  • AutoGenerateDto : INamedTypeSymbol
  • GenerateBeforeAndAfterAssignPartialsInMapping : INamedTypeSymbol
  • Ignore : INamedTypeSymbol
  • PropertySetting : 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) : string
  • GetAbsolutePath(string path, string basePath = null) : string
  • GetRelativePath(string fromPath, string toPath) : string
  • Resolve() : string

OptionsTryGetFunc

delegate

No description.

Constructors

  • OptionsTryGetFunc(object object, IntPtr method)

Methods

  • BeginInvoke(string key, out string value, AsyncCallback callback, object object) : IAsyncResult
  • EndInvoke(out string value, IAsyncResult result) : bool
  • Invoke(string key, out string value) : bool

Back to the package page