Skip to content

Filter which templates are applied #81

@truegoodwill

Description

@truegoodwill

Currently, we can create templates that are applied based on the underlying type.
I'd like to be able to create templates that are optionally applied if the underlying type matches AND some other marker is also present on the partial type.

public partial readonly record struct MyId : IStructId<long>;

public interface IMarkerFunnyStuff;

// This template is NOT applied because MyId does not implement IMarkerFunnyStuff

[TStructId]
file partial readonly record struct TSelf(long Value) 
{
  public void DoFunnyStuff() {} 
}

// Adding this to the template file means that the template is ONLY applied if MyId also implements IMarkerFunnyStuff
file partial record struct TSelf : IMarkerFunnyStuff;

Back this issue
Back this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions