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

Add plugin sample #3644

Closed
wants to merge 3 commits into from
Closed

Add plugin sample #3644

wants to merge 3 commits into from

Conversation

virzak
Copy link
Contributor

@virzak virzak commented Dec 29, 2021

No description provided.

Copy link
Member

@roji roji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR.

We have plans to improve documentation on writing providers (#681, for this page), we could also have a page on how to write a plugin.

We usually add samples with the corresponding conceptual documentation; a code sample alone (such as this) isn't easily discoverable by users looking at the docs. If the goal is simply to have a working plugin source to look at, then simply pointing to e.g. the NetTopologySuite source code may be enough.

Note also that this sample shows only IMethodCallTranslatorPlugin, but there are other plugin types (e.g. ITypeMappingSourcePlugin, IEvaluatableExpressionFilterPlugin, IConventionSetPlugin...).

samples/core/SqlServer/Plugin/PluginSetup.cs Outdated Show resolved Hide resolved
@virzak
Copy link
Contributor Author

virzak commented Dec 29, 2021

Hi @roji,

This PR was started in an attempt to reproduce a possible bug in EF Core PawelGerr/Thinktecture.EntityFrameworkCore#17

I didn't find an existing test case to modify in dotnet/efcore, because I'm either not familiar with it or because it wasn't there.

Still hoping to reproduce the issue, but in the meantime the PR was a good exercise for me to isolate the plugin concept. If the PR gets merged and helps someone else - that's a bonus.

@virzak
Copy link
Contributor Author

virzak commented Dec 29, 2021

Issue dotnet/efcore#27075 was the original reason for this PR

@roji
Copy link
Member

roji commented Jan 4, 2022

@virzak we've discussed this internally, and the decision is that we prefer not to add standalone code samples that aren't part of corresponding conceptual documentation. In other words, something like this would definitely make sense as part of #681, but we don't think that having the code without any docs is very helpful.

Good luck with your bug and let us know if you need any help.

@roji roji closed this Jan 4, 2022
@virzak
Copy link
Contributor Author

virzak commented Jan 4, 2022

@roji Yeah, that's cool. You mentioned that you're pointing developers to NetTopologySuite source code. Perhaps a plugin/README.md could have that link until #681 is complete. It would make sense for me, as I am who tends to look at the source code a lot more than reading documentation.

@roji
Copy link
Member

roji commented Jan 4, 2022

I'm not sure a plugin/README.md would be very discoverable either - I think at some point we need to do #681...

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

Successfully merging this pull request may close these issues.

2 participants