I'm looking for honest feedback on my content. Please comment or reach out to me on Twitter!
Have you ever seen one of those dropdowns that popula...
For further actions, you may consider blocking this person and/or reporting abuse
A few errors here:
In your screenshot, you name the DB "zipcodes.db", then you have us run a migration, which creates a "cities.db", created from the Context.
Startup.cs references "zipcodes.db", instead of the "cities.db" references in CityContext.
If we change everything to "cities.db" (or "zipcodes.db") and then try to import the data from a CSV, you can't override the existing Cities table because DB Browser won't allow you to import the CSV into an existing table (the DB created from the migration) if it doesn't have the same number of matching columns. You need to add the "CityZip" column to the CSV file first.
If we create a new DB from DB Browser and import the CSV into it, EF will connect, but throw an error because the "CityZip" column that EF adds doesn't exist.
You name your table on import "zips", but your app is looking for the "Cities" table.
Make sure to not have your DB open in DB Browser, or EF will report that the DB is Locked.
Once you change all occurrences of "zipcode.db" in your code to "cities.db", add the blank CityZip column to the CSV and import it into the DB created from the migration, all should run nicely ;) You don't need to manually create the DB, the migration will output the file for you.
Thank you for the helpful feedback. I clearly missed a few things while putting it together. I have made corrections to the article and will have the project hosted up on GitHub soon so people can take a deeper look at it.
Thanks again!
No problem! I was looking for some resources to learn .NET Core (I'm a front end dev at a .NET shop) and I'd saved your tutorial a while back to try out. The errors actually forced me to learn the material better, since I had to do some troubleshooting to get everything running :P
It's not really about the service, but learning how to build it that's important. There may also be cases where people want to build their own to match certain requirements and this is a good place to start.
Nice tutorial, what about the data quality of simple map? I know zipcodes for instance in the UK are quite complex, I never found a provider (even paid service) that had good quality data.
I don't know much about it, my initial spot checks of ones in this area were pretty accurate. From what I understand the most accurate and updated version of it is the one you pay for.
I have not researched any UK databases, it sounds like a good business opportunity for someone who gets it right!