I have a class Booking
public class Booking
{
public int Id { get; set; }
public string From { get; set; }
public string To { get; set; }
}
I create a List bookings with the help of linq and I want some mechanism with which I want to autogenerate the 'Id' property to increment by 1.
I.e. if the List bookings contains 10 Booking object then the first object's Id = 1, second Id = 2 and so one...
any suggestion