If I have list of Author objects like
List<Author> authors = new List<Author>{
new Author { Id = 1, Name = "John Freeman"};
new Author { Id = 1, Name = "Adam Kurtz"};
};
this example is actually wrapped in static method which returns list of authors.
Inside my other object there is property Authors of type List<Author>.
Now I want to assign second author from the list to Authors property.
I thought that I can use Authors = GetAuthors()[1].ToList();
but I cannot access ToList() on index specified author.
to clarify
private static List<Author> GetAuthors() return list of authors (example above).
var someObject = new SomeObject()
{
Authors = // select only Adam Kurtz author using index
// and assign to Authors property of type List<Author>
};
Authors = new List<Author>(){someObject[1]};?