I tried this code for adding b
to books
:
IEnumerable<Book> books =null;
foreach (Book b in context.Books.AsEnumerable())
if (someConditions)
books = books.Concat(new[] {b});
but gives me this error on last line of code:
System.ArgumentNullException: Value cannot be null. Parameter name: first
it seems that null
Collection
could not concatenated. I use EF,so how should I initialize my Collection
that have no thing in it and I could concatenate to it?