Dotnet Minimal Api Denemeleri

app.MapGet("api/getAnil",()=>
{
Human human=new Human("anil",88,"Computer Engineer");
return human;
}
);
//That's so Node.js
app.MapGet("/parametredeneme",(int id,string onemli)=>
{
return id+" onemli: "+onemli;
}
);
//https://localhost:7125/parametredeneme?id=44&onemli=deneme
app.MapPost("/postDeneme",(Human human)=>
{
return human;
}
);
//curl -H "Content-Type: application/json" -X POST -d '{"name":"bir","Age":2,"Profession":"Sociologist"}' https://localhost:7125/postDeneme/
app.MapGet("/Model",null); app.MapGet("/Model/{id}",null); app.MapPost("/Model",null); app.MapPut("/Model/{id}",null); app.MapDelete("/Model/{id}",null);
app.MapGet("/badrequest",()=>{ return Results.BadRequest("Problems"); });
app.MapGet("/birdiger/{id}",(int id)=>{
return Results.Ok(id);
}
);
//https://localhost:7125/birdiger/1446544

--

--

--

Computer Engineer,Sociologist, CSE Master Student

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
anıl kaynar

anıl kaynar

Computer Engineer,Sociologist, CSE Master Student

More from Medium

Microsoft .NET 6 -What’s All About The New Update

Unable to find an OpenAPI description error in .net 6 REPL CLI tool

Fixing my BF1942 woes with Win32 APIs

Write a code to retrieve data from table into a datagridview in CSharp