I have the following two objects:
public class BlogPost
{
public int BlogPostId { get; set; }
public Author Author { get; set; }
}
public class Author
{
public int AuthorId { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
}
I have two separate lists of 50 Blog Post objects and 50 Author objects. How do I combine the two such that the Author object is assigned to the Blog Post's Author property?
I've tried using the Zip
method, but I don't think that's quite what I want. This question is similar, but I want value
to be an object from another list.
Context: using the Seed method in EntityFramework to populate my database.
EDIT: I should have mentioned that, because it is seed data, I don't really care which Author gets matched up to which BlogPost. Hence why I was trying to use the Zip method.