Skip to content

Configuration

Stefan Ossendorf edited this page Feb 14, 2024 · 2 revisions

How to configure the source generator

Here you will find all available source generator configuration options and how to use/set them.

Available configuration options

csproj property group entries:

  • DataPortalExtensionGen_MethodPrefix
  • DataPortalExtensionGen_MethodSuffix

As the names suggest these properties add a static prefix or suffix to every generated extension method.

csproj example:

<Project Sdk="Microsoft.NET.Sdk">
    // Other entries necessary
    <PropertyGroup>
        <DataPortalExtensionGen_MethodPrefix>Prefix</DataPortalExtensionGen_MethodPrefix>
        <DataPortalExtensionGen_MethodSuffix>Suffix</DataPortalExtensionGen_MethodSuffix>
    </PropertyGroup>
</Project>

Generated methods will now look like this:

// See the prefix and suffix around the method Foo
public static Task<YourType> PrefixFooSuffix(this IDataPortal<YourType> portal, ...){}

Clone this wiki locally