I try to add new record to my list and change data of it, but it's change all record of array, here is my class and code:
The class:
public class TransportDto
{
public int type { get; set; }
public string url { get; set; }
public int Relationship { get; set; }
}
loading data to my list:
IQueryable<TransportDto> list = _entities.Database.SqlQuery<TransportDto>(filterExpression).AsQueryable();
List<TransportDto> lst = list.ToList();
TransportDto help =lst[1];// adding record like one of my result
lst.Add(help);
Now I try to change value of lst[lst.Count-1] but when I change it , lst[1] change too
lst[lst.Count-1].type=3;
on result both lst[lst.Count-1] and lst[1] changes to 3, but I just try to change one record of array