c# - Inserting a list within a list -


As of now, I have two lists, one of these students list, second, what is the list of classes After classing and preparing a list of students, how will I copy the list of students in classes.

I say, make a class called "chemistry" which is added to the list of classes (element 0). Once when I enter a list of students, then I How to copy / replace the list of

I think the question is a bit unclear, it is basically such that I can make the classroom dynamically and just add a list of students in any class.

Thank you for your time.

  using the system; Using System.Collections.Generic; Using System.Linq; Using System.Text; Namespace P3_O_O_P {Public class class {public list & gt; Module & gt; RoomList; Public class () {roomList = new list & lt; Module & gt; (); } Classroom (Module OZMode) to create public Zero {console.light ("enter \ n room name:"); ObjMod.ModuleName = console.readline (); Console Type ("\ nOpen a module ID code:"); ObjMod.ModuleID = Convert Repeat (console; readline ()); Room list Add (New module (objMod.ModuleName, objMod.ModuleID)); } List of Public Zero Classes () {foreach (different modules in room type) {console. Type ("\ nModule:" + Module); }}}} Public Zero addStudent (student student, module objMod, classmobile objClassroom, int mark) {objMod.registerList.Add (new registration (student, icon)); ObjMod.Enrol (student, mark, objClassroom); }    

I modify the class class to include I can do a list & lt; Students & gt; .

Make the setter private so that the list can not be set to null or classroom class. The public recipient will send you the add () , remove () , etc.

  Allows public class class {... public list & lt calls. ; Students & gt; Student {Received; Private set; } Public class () {... student = new list & lt; Students & gt; (); } ...}   

then add it to the list inside your method:

  public zero addStudent (student student, module objMod, classmobile objClassroom, int mark ) {... objClassroom.Students.Add (student); }    

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -