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

Example project not working #141

Closed
aerotog opened this issue Mar 15, 2018 · 2 comments
Closed

Example project not working #141

aerotog opened this issue Mar 15, 2018 · 2 comments

Comments

@aerotog
Copy link

aerotog commented Mar 15, 2018

My team is currently migrating to .Net Core and have started testing the latest build of this project as it targets .Net Standard. During testing I found that the included example project does not work out of the box.

Related issues:

  • The database created is SQLite but the included SQL scripts are not valid for SQLite (The syntax for creating foreign keys and identity columns is incorrect)
  • Controllers are missing [Route] tags so they cannot be hit
  • SQLite exceptions are thrown when trying to access the DB via controllers

Most of the problems seem to stem from the move from SQL Express to SQLite which happened when the main project was updated to target .Net Standard.

There may be more related issues I haven't seen as each successive issue was found after fixing the previous one. I haven't yet solved the SQL query exceptions.

If someone could verify these are actual problems and not caused by me misusing the example project, that would be appreciated.

If I manage to get it working locally I'll open a PR with my changes.

@aerotog
Copy link
Author

aerotog commented Mar 15, 2018

I spent a couple hours to get the example project working. I tried to make the routes the same as they were documented previously.

I had to make some changes to the SQL files to make them SQLite compatible. While the database itself does get generated automatically, the tables do not. It looks like the project was using DbUp previously to populate the database. As DbUp is no longer included, the SQL now needs to be run manually before testing.

I'll open a PR in a few minutes.

Two oddities I noticed and cannot explain:

  • The JsonHalMediaTypeInputFormatter needed to be disabled to get responses that weren't empty. (This may be a bug in the main project)
  • HAL representations are being generated and returned with or without the "Accept application/hal+json" header. I saw this mentioned yesterday in an old ticket which I can no longer find. I'm not sure if this is working as intended or not.

@aerotog
Copy link
Author

aerotog commented Mar 16, 2018

After further testing, I think the JsonHalMediaTypeInputFormatter issue is indeed a bug in the main project. I've opened #143 to fix this.

panmanphil added a commit that referenced this issue Mar 17, 2018
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