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

Attempting to create a new project through the API results in an error regarding the 'CreateProjectDTO' interface. #545

Closed
eduardogoncalves opened this issue May 1, 2023 · 1 comment

Comments

@eduardogoncalves
Copy link
Contributor

It's not possible to create a new project using the endpoint [POST]/api/Projects.
When trying, it gives an error: Could not create an instance of type Clean.Architecture.Web.ApiModels.CreateProjectDTO. Type is an interface or abstract class and cannot be instantiated. Path 'name', line 2, position 9.
image

image

image

ardalis added a commit that referenced this issue May 1, 2023
@ardalis ardalis closed this as completed in b117ac7 May 1, 2023
eduardogoncalves added a commit to eduardogoncalves/CleanArchitecture that referenced this issue May 1, 2023
eduardogoncalves added a commit to eduardogoncalves/CleanArchitecture that referenced this issue May 1, 2023
@eduardogoncalves
Copy link
Contributor Author

Hi @ardalis with your fix, it still gives an error, because the constructor is protected.
image

I've sent a PR #546 that fix it and add a test.

ardalis pushed a commit that referenced this issue May 1, 2023
* fix #545: removing abstract and setting constructor public

* #545: adding a test to create a new project via /api/projects to prevent future bugs
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

1 participant