Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working with Mapperly and MS Community Toolkit #533

Closed
michaeltagmose opened this issue Jul 3, 2023 · 1 comment
Closed

Working with Mapperly and MS Community Toolkit #533

michaeltagmose opened this issue Jul 3, 2023 · 1 comment

Comments

@michaeltagmose
Copy link

It seems that using Mapperly together with Microsoft Community Toolkit is not possible, unless somebody can give me some good advice.

I have a number of uses of MSCT like this:
[ObservableProperty]
private ArtifactTypeEnum m_ArtifactType;

The aim is to get a property named
public ArtifactTypeEnum ArtifactType { get ... set ... }
generated by the Toolkit generator in a partial class.

When I Map this property using Mapperly, it is not found.
I get this error
RMG012 Property ArtifactType on source type ...Clients.Models.ArtifactMdl was not found

The setup of the mapping is like this
public static partial ArtifactDto ToDto(this ArtifactMdl src);

I expect the mapper to find the property and map it, even though it is found in
a partial class generated by some generator.

My guess is that the two generators need to run in a different sequence.
Are there any workarounds to this behaviour?

  • Mapperly Version: 2.7.0
  • .NET Version: 6.0
  • Target Framework: .net6.0
  • IDE: Visual Studio v17.6.4
  • OS: Win 10
@latonz
Copy link
Contributor

latonz commented Jul 3, 2023

AFAIK chaining source generators is not supported by Roslyn and I don't know any workarounds despite implementing the generated code by hand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants