I have the following classes.
Car.cs
public class Car
{
}
scoda.cs
public class scoda : Car
{
}
Test.cs
public class Test
{
public ObservableCollection<scoda> scodaList;
public Test()
{
scodaList = new ObservableCollection<scoda>();
scoda s = new scoda();
scodaList.Add(s);
set(scodaList);
}
public void set(ObservableCollection<Car> list)
{
}
}
I got the casting error when calling set method as below
Cannot convert from 'System.Collections.ObjectModel.ObservableCollection<KillCarMain.deneme.scoda>' to 'System.Collections.ObjectModel.ObservableCollection<KillCardMain.deneme.Car>'
How to fix this problem ?