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

Source Generators with IMapper Interface #622

Open
ismkdc opened this issue Aug 19, 2023 · 4 comments
Open

Source Generators with IMapper Interface #622

ismkdc opened this issue Aug 19, 2023 · 4 comments

Comments

@ismkdc
Copy link

ismkdc commented Aug 19, 2023

Hello, I am using mapster with fec and I am very happy :)
But i am curious about something.. Is there any way for using source generators which is Mapster.Tool and IMapper interface?

So I want to still inject IMapper interface to my classes but I want use source generated mappings.

@EmreAka
Copy link

EmreAka commented Aug 19, 2023

I too was searching for it. It would certainly be great to have!

@salihcantekin
Copy link

salihcantekin commented Aug 20, 2023

If there is Source Generator supports for IMapper, that would take Mapster a few steps up. It would be the most common library for AOT base apps. I'd like to contribute to this development tho!

@andrerav
Copy link
Contributor

I think this is a great suggestion, however there may be a showstopper. Currently only netstandard2.0 assemblies can be used as source generators. Since Mapster and its constituent components are all net6.0/net7.0/net8.0 currently, I think it's currently not possible to run a source generator from Mapster. I might be wrong, this is just based on a quick readup on requirements for source generators, so I'm eager to hear your thoughts on this. It might be theoretically possible to bring netstandard2.0 back into Mapster, but it requires quite a few code changes since Mapster now relies on features not available in netstandard2.0.

@luizfbicalho
Copy link

I think that this is not an issue anymore

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

No branches or pull requests

5 participants