Adding a Service to an ASP.NET Core Website | ASP.NET Core 101 [4 of 13]

preview_player
Показать описание

ASP.NET uses a technique called "dependency injection" that's built right in. That lets us make classes called "services" that we can make available to any other classes in our website. Let's add a service now!

Learn more about ASP.NET:

Follow us:

Useful Links:
Рекомендации по теме
Комментарии
Автор

I wasn't able to understand everything here. There are design patterns and design constructs being used here, and without mentioning why somethings are the way they are, it feels I just know what code to put where - but not exactly why and how to modify this structure to suit my needs more.

SaifUlIslam-dixv
Автор

One important difference between IEnumerable and List (besides one being an interface and the other being a concrete class) is that IEnumerable is read-only and List is not. So if you need the ability to make permanent changes of any kind to your collection (add & remove), you'll need List

jackpnguinne
Автор

For future lessons I would recommend teaching how to change the code or data types to fit the database we want.. Yes its more time, but for beginners, this will help. This lesson helps if your doing the EXACT project in your video but doesn't really explain what to do if you weren't, which 100 % of probably aren't. For instance, I need to make an appointments website and not a products but now I have no idea how to edit the code because I am fed the code that works in this project. For example, I wanted to make a website for scheduling appointments, but this didn't really prepare me for making that. Its more or less going through a pre-built project and not basic 101 concepts, like when they "instead of me writing all this code..." I was like no, teach me how to write it, or at least explain whats going on, or I am really not learning anything at all except how to copy somebody else work on this one project.

lacheporter
Автор

I like your way of teaching, it is simple and easy to understand, also keeps me entertained, that is very important to me because i usually get bored with programming tutorials very fast :D Thank you

TheMrwanter
Автор

im following this in 2022 and whne i generate the web app template i dont get the same code in prgram.cs or a startup.cs file. does that mean i get to skip the part where i configure the startup services and everything will work as it should or is it done in a different way? if it is, how exactly?

yonatangoldin
Автор

I just started to look into web applications. I am a slow learner; this tutorial is as simple as it gets. Thank you guys.

josenunez
Автор

7:55 new JsonSerializerOptions { PropertyNameCaseInsensitive = true} is necessary.
If you don't do this then {"Title" from Product class will not be same as "title" from json file } same applies for all other property.
So you must add it otherwise your page will not render product.Title in next lesson as compiler won't be able to find "Title" in Json File because its "title"

niranjanwagh
Автор

Using VS2022 now. Seems things have changed quiet a bit since. My program.cs doesn't look like anything as shown. And there's not startup.cs to be found.

pieteb_nl
Автор

Explaining how a web app is basically just a console app was pretty insightful. Thank you!

SL
Автор

This is an awesome way to teach people - thank you!

IThinkDiffrent
Автор

I cannot find the code stated to be provided in the descriptions. Looked here as well as on the MS hosted version

mikemurphy
Автор

I Think this's the time to update this video or at least set the version on the title of the video.

BenyaminLimanto
Автор

Hey guys, you are the best. The way you explain the things makes me understand it easily. Thanks !

JosephMJJ
Автор

I couldn't find the startup file, it wasn't added for me by default too. my program.cs file too doesn't have all that code. I hope someone responds quickly 😒

lamanderson
Автор

Any workarounds to startup.cs no longer being supported?

michaeltorkaman
Автор

The best video tutorials I have ever seen. It's so pleasant to learn with you guys! Thank you very much for your great work!

RegulusVi
Автор

After spent an hour study this tutorial. i still don't get it. why the heck Serialize overthere instead Tostring() simple to remember ? why do i need ienumerable since List() is easy to remember for my memory. it seem to me I study this mountain but I have to climb another mountain that i never know it exist and how its function work. Those functions maybe familiar for who created asp.net but not suitable for learners.

mh-studio
Автор

I got confused when they were pasting the JsonProductService class. How do you get the code for the JsonProductService that they had pasted into visual studio at 2:45?

lorangaines
Автор

It looks like we need to comment out public void AddRating(string productId, int rating), correct?

robertnakamura
Автор

it was supposed to be a beginners course but it became a senior course

iagoantunes
join shbcf.ru