Intergrate Azure with xamarin table Error

Eduardo Gomez 3,416 Reputation points
2021-03-30T21:06:10.16+00:00

Hello everyone

I am learning Azure, So after finishing my XamContact app, to work perfectly with SQLite

I decided to Integrate Azure, I already did all the CRUD operation methods, but I get an error when trying to insert in the People table

]1]1

As you can see I have a People table, but for some reason, when trying to get something out via Postman, I get an error

https://github.com/eduardoagr/XamContact // here is my code

So I don't know if I am calling the wrong table

here is my ASP web

https://github.com/eduardoagr/Azure

What I don't understand is that if my table is name people, why if I put people in Postman it doesn't get it, but if I put http://xamxontacts.azurewebsites.net/tables/person?ZUMO-API-VERSION=2.0.0 I can get

If you see, I have a people table
82923-image.png

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,290 questions
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
35,821 questions
{count} votes

Accepted answer
  1. Ryan Hill 25,476 Reputation points Microsoft Employee
    2021-04-02T22:50:24.067+00:00

    You're using Entity Framework migrations to create/update the database schema; https://github.com/eduardoagr/AzureBackEnd/blob/729cf33c16849ebeddc5c072a1f35162784c8db0/ZUMOAPPNAMEService/App_Start/Startup.MobileApp.cs#L26.

    var migrator = new DbMigrator(new Migrations.Configuration());
    migrator.Update();
    

    It will pluralize Dto's to table names; check out this blog post. However, what's odd is when checking your repo, you don't have a "Person"/"People" object in the context, it's called contacts. I even checked your migrations and the table created is Contacts. You also have ContactController in the PersonController filename. It's not decorated with [MobileAppController] which may affect offline sync but should be fine for making request from Postman. Instead of person/people, try making the request to /contacts and see if you still get the error. If you still get an error, then how did you create the database to begin with?


0 additional answers

Sort by: Most helpful