You almost answered the question yourself in your question. If you search for ".net implicit conversion" you'll turn up this page (http://msdn.microsoft.com/en-us/library/z5z9kes2.aspx) that shows you how to create implicit type conversions. Based on that, I modified your classes as follows:
class Human
{
public string Name;
public int Age;
public Human( string name, int age )
{
Name = name;
Age = age;
}
public static implicit operator Doggy( Human human )
{
return new Doggy( human.Name, human.Age / 7 );
}
}
class Doggy
{
public string Name;
public int Age;
public Doggy( string name, int age )
{
Name = name;
Age = age;
}
public static implicit operator Human( Doggy dog )
{
return new Human( dog.Name, dog.Age * 7 );
}
}
Then you can use it like this:
Human human = new Human( "Fred", 42 );
Doggy dog = human;
Console.WriteLine( "As a Human, {0} would be {1}", human.Name, human.Age );
Console.WriteLine( "As a Dog, {0} would be {1}", dog.Name, dog.Age );
Console.ReadLine();
The whole point is that the conversion is implicit, you just need to assign one type to the other and the conversion happens magically.