Welcome to Xamarin Guy Show Blog

Keep updated for latest and Greatest Posts from Xamarin guy

Asp.net core Perfect learning tutorial [Sampurna] #2

Hey guys in this tutorial we are going to create a simple asp.net core web api migrating to data base. and making some crud operation.

Create a new project > Asp.netcorewebApp>WebApplication4(Anyname) >SelectApi>

At first check your project is running or not.

Create a new Folder Naming it as Models>create a class(TicketClass)


Create a TicketContextClass inside model Folder Name it as TicketContext.cs

//here DbContext inherits from using Microsoft.EntityFrameworkCore;

//This TicketItems will take all the contents from the database so of course we need to tell data base to get connection :
so lets go to Startup.cs

If you don’t know how to access the GetConnectionString then you can store it on in memory database see this


Now we are all ready to store it on db.If using in memory db you don’t need to perform this steps:

Inside PackagemanagerConsole:
Add-Migration Initial
That’s all
Now it’s time to Create a TicketController.cs inside TicketController Folder.
Insert This code to create read update and delete.

now it’s time to use postman before that you have to disable ssl certificate option inside your project properties.

Hit this url for

select post>body>raw>select JSON/(application/json)
send this:

"concert": "Xamarin",
"artist": null,
"available": true

selectput>body>raw>select Json(application/json)
“concert”: “Xamarin”,
“artist”: null,
“available”: true

Leave a Reply

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.