Hi
I have a
class Person : IPerson
and a
class Employee : Person, IEmployee
and an
interface IEmployee : IPerson
Say I have a method like
IPerson GetPerson(long id)
{
return new Person();
}
How do I turn the "Person" object into an "Employee" object?
Do I need to instantiate a new Employee and copy the fields from the
Person object manually (and add the extra data an Employee holds)?
I was hoping I could do something like:
IEmployee employee = (IEmployee)person;
employee.Company = "my co";
but I soon found out that won't do.
Thanks,
Peter