C# Tutorial: Lists of Objects

  Рет қаралды 41,780

Ian Schoenrock

Ian Schoenrock

Күн бұрын

Пікірлер: 34
@balasenk
@balasenk 4 жыл бұрын
Ian, i really appreciate your work. You way of approaching code is interesting, please do more. all the best.
@ianschoenrock2285
@ianschoenrock2285 4 жыл бұрын
Thanks for the comment. I'm currently working on the twitter course, haven't been posting a ton lately because I've been doing more research with API deployments and making sure that I can teach it in the most beginner friendly way possible. More videos should be coming out soon though!
@alphasauroxviix4235
@alphasauroxviix4235 3 жыл бұрын
this video is amazingly amazing, how you're not above 100k subscribers is beyond me, you earned yourself a new loyal subscriber my guy
@Havok256
@Havok256 4 жыл бұрын
Create a C# menu-driven console application using OOP concepts that comprises the following functionality, 1- Ability to register a student details (Name, Gender & Age) 2- Ability to view student list. 3- Ability to view delete & edit students
@ianschoenrock2285
@ianschoenrock2285 4 жыл бұрын
Sounds like a fun homework project. I would check out my video on Properties, Classes, and Objects. If you have a solid understanding of those and this video as well, then this project should be very do-able.
@marioluissaldanhasantos1286
@marioluissaldanhasantos1286 3 жыл бұрын
I'm so pleased to watch your videos because you explain how to code so well and step by step. I really appreciate your help and please keep posting more videos about coding. You are fantastic. Cheers.
@gabrielfs4713
@gabrielfs4713 2 жыл бұрын
Ian, tks man! I'm really enjoy this video. From Brazil.
@syedmubazir4371
@syedmubazir4371 2 жыл бұрын
Simple and Awesome Content! ❤️⭐💯Thanks alot.
@RobinNilsson-z7s
@RobinNilsson-z7s Жыл бұрын
Hello, so I am working on making a simulation of a bus, I have managed to make passengers and make it store them, but I have run into problems now when it comes to making functions for the list of objects. Like for instance if I wanted the user to give a parameter of an age let's say 100-80. And then it returns the passengers that match that age. Can't seem to figure out how to do something like that.
@daniyalihsan4264
@daniyalihsan4264 3 жыл бұрын
Hi lan I have a question that how can I assign a unique Guid to each object inside the collection of objects,so that later on it could help me in removing the specified object only through UI controls.
@malinisaranya7191
@malinisaranya7191 3 жыл бұрын
Ian , I have a list of 50000 record I read from sql ..now how to split the list into smaller list in c# ...Any idea?
@MuhammadAziz-tb8zr
@MuhammadAziz-tb8zr 3 жыл бұрын
Can I ask. If I make list of button with code : List btn = new List(); How can I add all of buttons in the list to forms's control? I tried using : This.Controls.Add(btn); But it's didn't work somehow.
@zerosandones7547
@zerosandones7547 3 жыл бұрын
do we need fields when creating a model class? or are the auto properties enough?
@josephozurumba
@josephozurumba 4 жыл бұрын
This is a great content. My suggestion is try and re-arrange your C# tuorial, so they are in order. Topics are not sequential. A question for you, which book would you recomment for C#. Thanks
@ianschoenrock2285
@ianschoenrock2285 4 жыл бұрын
I thought I arranged the videos in order but your right, I'm going to have to fix that. My favorite book on C# is "C# 7 and .NET Core 2.0". Its huge and goes over everything. Its what I base many of my tutorials off of. Here is a link: www.amazon.com/Professional-NET-Core-Christian-Nagel/dp/1119449278/ref=sr_1_3?dchild=1&keywords=C%237+and+.NET+Core+2.0&qid=1595977072&sr=8-3
@-Plube-
@-Plube- 2 жыл бұрын
How do I copy an array of these into another object using this list method. I see zero tutorials online.
@aranya96
@aranya96 3 жыл бұрын
I really appreciate your hard work. Is this possible to make it dynamic rather than raw code?
@AremuKamal-j1n
@AremuKamal-j1n Жыл бұрын
pls sorry for asking, pls why do you used for each
@vova1165
@vova1165 2 жыл бұрын
Thank you, that helpful
@majesticartist8761
@majesticartist8761 3 жыл бұрын
thank you man! you solved my problem
@TauroChuck
@TauroChuck Жыл бұрын
Thank you
@1311kiewo
@1311kiewo 3 жыл бұрын
Ian, how can I remove Contact Kenny?
@phone6974
@phone6974 3 жыл бұрын
Ian how to use this list in another class?
@Shakespeare1612
@Shakespeare1612 4 жыл бұрын
How would you search for a contact with a specific name and then show that specific name and phone number?
@ianschoenrock2285
@ianschoenrock2285 4 жыл бұрын
Great question. a simple way would be to loop through each item in the list and see if it is equal to the search text. if it is then return the desired information. Take a look at the example below: var searchText = "Ian"; foreach(var contact in contacts) { if(contact.Name == searchText) { Console.WriteLine(contact.Name); Console.WriteLine(contact.PhoneNumber); } } I would highly suggest looking at my video that explains class properties because that is essentially all this is. Hope that helps!
@sampathchaganty8519
@sampathchaganty8519 2 жыл бұрын
how to fetch using name in list of objects
@Shakespeare1612
@Shakespeare1612 4 жыл бұрын
How can you deal with lists, inside of lists, inside of lists. Like a list of casinos, each of which has a list of tables, each of which has a list of card decks, each deck deals a number of games, each game has a list players and hands, a list of cards in a discard pile and a list of chips in the pot, as well as in each player's possession. Finally each hand has a list of cards. Let's go pro here. Let's conquer serious REAL WORLD use cases.
@ianschoenrock2285
@ianschoenrock2285 4 жыл бұрын
if you want to nest lists you can just do List. For instance if I had a list of casinos and wanted to access the list of tables I would do the following: 1. Create a casino class 2. Create a table class 3. Inside the table class add the properties (dealer, card deck, etc) 4. Inside the casino class create a property that is a list of tables: public List tables {get; set;} 5. inside your program create a list of casinos: List casinos = new List(); 6. Reference a specific table from a specific casino (in this case the fifth table from the first casino): casinos[0].tables[4] You can go as deep as you would like but that is the basic concept. Also keep in mind for this series we are explaining major concepts at a more surface level. There is a lot you could do with lists, but if you understand how a basic list is made and the relationship between your data then going deeper into it isnt terribly difficult. Hope this helps!
@143ryan8
@143ryan8 3 жыл бұрын
If anyone is seeing this, how do I instead of .Add() change it to accept Inputs from users like console.readline() for Name, PhoneNumber and Age???
@daniyalihsan4264
@daniyalihsan4264 3 жыл бұрын
Hi it is simple you should have to create a private field name(name,age,phone number ) and then assign the Console.ReadLine() based user input into it those private fields.and finally at the place of.add(place the above inputs).job done.
@Havok256
@Havok256 4 жыл бұрын
how do you delete and edit
@ianschoenrock2285
@ianschoenrock2285 4 жыл бұрын
Here is a link on how to delete a list item: stackoverflow.com/questions/18917725/c-sharp-remove-object-from-list-of-objects Here is a link on how to edit a list item: stackoverflow.com/questions/4914802/editing-an-item-in-a-listt Remember to practice the concepts not just copy the code!
@vycka7360
@vycka7360 3 жыл бұрын
OOF, nice name
C# Tutorial: Stacks
4:24
Ian Schoenrock
Рет қаралды 5 М.
C# Tutorial: Properties, Getters and Setters
11:39
Ian Schoenrock
Рет қаралды 27 М.
НИКИТА ПОДСТАВИЛ ДЖОНИ 😡
01:00
HOOOTDOGS
Рет қаралды 3 МЛН
Сюрприз для Златы на день рождения
00:10
Victoria Portfolio
Рет қаралды 2,7 МЛН
Gson Tutorial - Mapping of Arrays and Lists of Objects
18:04
Future Studio
Рет қаралды 53 М.
How To Create Generics in C#, Including New Features
38:51
IAmTimCorey
Рет қаралды 49 М.
C# Arrays, Lists, and Dictionaries (Quick dotnet tutorial)
19:51
Dev Leader
Рет қаралды 2,8 М.
Classes & Objects | C# | Tutorial 25
13:25
Giraffe Academy
Рет қаралды 175 М.
C# 11 - List Patterns
17:29
Coding Tutorials
Рет қаралды 2,7 М.
C# Constructors Tutorial | Mosh
23:24
Programming with Mosh
Рет қаралды 237 М.
C# Lists 📃
6:46
Bro Code
Рет қаралды 106 М.
C# Tutorial: Classes and Objects
11:37
Ian Schoenrock
Рет қаралды 6 М.
C# Properties: Why use "get" and "set"
14:53
Tom McCurdy
Рет қаралды 66 М.
Inheritance | C# | Tutorial 31
10:29
Giraffe Academy
Рет қаралды 58 М.