I have a basic array list of objects. It accepts a string, a double, a double and a string. I need to sort the list by the final string. How do I sort this array list by typeIn which is a string?
private void button1_Click(object sender, EventArgs e)
{
nameIn = textBox1.Text;
lengthIn = Double.Parse(textBox2.Text);
weightIn = Double.Parse(textBox3.Text);
typeIn = textBox4.Text;
Bird newBird = new Bird(nameIn, lengthIn, weightIn, typeIn);
birdList.Add(newBird);
var sortedList = Bird.birdlist.OrderBy(x => x.Type).ToList();
}
It does not allow me to order by. The red underline in the error is under Orderby