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

Generic Interface #63

Closed
luizbon opened this issue Oct 22, 2014 · 5 comments · Fixed by #70
Closed

Generic Interface #63

luizbon opened this issue Oct 22, 2014 · 5 comments · Fixed by #70
Labels

Comments

@luizbon
Copy link

luizbon commented Oct 22, 2014

Is there any support to generic interfaces?

@bennor
Copy link
Contributor

bennor commented Oct 22, 2014

I don't think there is at the moment. I'm curious as to what the use case is and how you'd need it to work?

@luizbon
Copy link
Author

luizbon commented Oct 22, 2014

Imagine you have the same API over and over that has only two differences:

  • URL
  • Type (Return and Post)

This is common for CRUD applications working with RESTfull services

Maybe an polymorphic service that depending on your application you want to use one class on some point and another on the oder, and both access the same service. Since you normally accessing an external service, this can be real.

@bennor
Copy link
Contributor

bennor commented Oct 22, 2014

Okay, yeah, I can see the value. I am fairly sure that won't work at the moment and will require a bit of work to implement. If @paulcbetts isn't opposed to the idea, I'll have a crack at it over the weekend.

@luizbon
Copy link
Author

luizbon commented Oct 22, 2014

I've tried to spike something, but it didn't work well, I don't have experience with expression trees.
The point that I get was inside InterfaceStubGenerator on FindInterfacesToGenerate.
When I have a generic interface it breaks on line 54 of InterfaceStubGenerator because the generic argument is not an IdentifierNameSyntax

Hope this helps

@bennor
Copy link
Contributor

bennor commented Oct 26, 2014

This is almost good to go, but I branched off #67, so I'll wait until that's merged before making a PR for this.

@lock lock bot added the outdated label Jun 25, 2019
@lock lock bot locked and limited conversation to collaborators Jun 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants