Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am using C#. My goal is to use a list with different amount of numbers of input. All inputs are strings. List I want

I am using C#. My goal is to use a list with different amount of numbers of input. All inputs are strings. List I want to add to the list in a for a loop. Can I use a method with unknown parameters? My attempt gives me the desired result, but is not robust and I cannot reuse it. Is it possible to make one method instead of having several different methods?

My attempt was:

var customList = new List();

for (int i =0; i

{

string a = "jhjejghjuwn";

string b = "uhtu";

string c = "uhrtgiueio";

string d ="rhjtrg";

...

customList.add(new MyClass.MyList(a,b,c,d));

}

__________________________________________

public static class MyClass{

public class MyList{

public string a {get;set;}

public string b {get;set;}

public string c {get;set;}

public string d {get;set;}

public MyList(string a, string b, string c, string d)

{

this.a = a;

this.b = b;

this.c = c;

this.d = d;

}

}

}

Use LINQ to orderby

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

(a) Determine the model for the full factorial experiment.

Answered: 1 week ago

Question

denigration of emotional outbursts; being reserved;

Answered: 1 week ago