N
Nigil
Hi Guy,
I am having issues casting my _Propery back to the _User. Can someone kindly
advise me.
Following is the code.
using System;
class Property
{
private string _Name="";
public string Name
{
get {return _Name;}
set {_Name=value;}
}
}
class Userroperty
{
private string _ID="";
public string ID
{
get {return _ID;}
set {_ID=value;}
}
}
class App
{
public static void Main(string[] args)
{
User _User=new User();
Property _Property=new Property();
_Property.Name="Lavey";
_User=(Property)_Property; // Here is where the compiler throws error.
Console.WriteLine(_User.Name);
Console.Read();
}
}
I am having issues casting my _Propery back to the _User. Can someone kindly
advise me.
Following is the code.
using System;
class Property
{
private string _Name="";
public string Name
{
get {return _Name;}
set {_Name=value;}
}
}
class Userroperty
{
private string _ID="";
public string ID
{
get {return _ID;}
set {_ID=value;}
}
}
class App
{
public static void Main(string[] args)
{
User _User=new User();
Property _Property=new Property();
_Property.Name="Lavey";
_User=(Property)_Property; // Here is where the compiler throws error.
Console.WriteLine(_User.Name);
Console.Read();
}
}