I have class Zones with properties and i want add data which i read with linq to this properties.
example
List<Zones> z = new List<Zones>
z.add(new Zones(...));
var allZones = from s in db.Zones select s;
How can i add allZones to z generic List?
You can do it in a number of ways:
z.AddRange(allZones); // if there are other elements in z
z = allZones.ToList(); // if there are no other elements in z (creates a new list)
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