Not sure what I am doing wrong syntax-wise here
var inventories = new List<Inventory>().Add(new Inventory
{
});
Compile-time error:
cannot assign void to implicitly-typed local variable
List.Add
returns void
. Try
var inventories = new List<Inventory>(){ new Inventory() };
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With