✅ I want to learn ASP.NET Core Web APIs.
Hi,
I want to learn how to make my own API in C# (coming from JavaScript/TypeScript).
Because of my history with TypeScript, I would say I "get the gist" of the C# language, but I will definitely need to watch a course on the fundamentals eventually.
But, regarding ASP.NET Core Web APIs, there has been multiple examples I've seen which make use of loads of (default and additional) classes and methods that seem to overwhelm me.
TL;DR: I guess I'm just curious how one might easily get used to everything that's provided? Is there maybe a specific, easy-to-read (Microsoft website blows imo) website page for learning all the default classes and methods that come with building a Web API?
My goal is to eventually build an API with stateless sessions for securty (In JavaScript, I was using libsodium).
Any extra tips are greatly appreciated, thanks!
10 Replies
Look into Minimal APIs if you're familiar with Express
Auth is mostly built-in with Identity
https://learn.microsoft.com/en-us/aspnet/core/tutorials/min-web-api?view=aspnetcore-9.0&tabs=visual-studio
Thank you, I will take a look!
What if this API I want to make is supposed to be the backend that goes with a website and a Discord bot? The website and Discord bot will be in JavaScript/TypeScript.
I assume that wouldn't be considered minimal then? I would like to basically do what I've done in JavaScript but in C# (security, job queues, NoSQL database, etc).
Minimal APIs is just the name for the
app.MapGet("/foo", () => "Hello")
style of writing it, as opposed to the classic controller style
They're not minimal in the sense of feature-richnessAlso, is there a page somewhere that might visually show all the methods which can be used for certain middleware or the builder.Services container, etc?
I see, thank you
I don't think there's a list of every middleware and everything that can be injected
Hmm, that's a bummer.
So, I'd just have to get the hang of it and (for example) view my options from IntelliSense then?
Or just know what you want
Then you're just one "asp core cache" search away from knowing what you need to inject to get a cache access
I see.
Thank you
Take a look at the courses of this guy (he is very recognized in the .NET community) https://courses.dometrain.com I'm passing the REST API course and it's very good.
Thank you!